title: Android back button not working for multiple activities
body: <p>I am new to android.</p>
  
  <p>I have <code>three activities A,B and C</code>.</p>
  
  <p>In the <code>activity B</code> I have a <code>listView</code> with the list of items.<code>On click</code> of each item I want to show item details in the third activity`.It is working fine.</p>
  
  <p>But while click on the back button of the third activity in an emulator it showing me that my application has stopped working.</p>
  
  <p>I am not able to redirect to the second activity.</p>
  
  <p>But <code>from the second activity,</code> I am able to come <code>back to the first activity</code>.</p>
  
  <p>How can I resolve this problem?</p>
  
  <p><strong>In activity C</strong></p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_display);
          Intent intent = getIntent();
          Bundle extras = intent.getExtras();
          String displayTitle = extras.getString("title");
          String displayPrice = extras.getString("price");
          String BasicInfo = extras.getString("BasicInfo");
          try {
              BasicInfoobj = new JSONObject(BasicInfo);
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
          txtTitle = (TextView)findViewById(R.id.display_txtTitle);
          txtPrice = (TextView)findViewById(R.id.display_txtPrice);
          txtLocation =(TextView)findViewById(R.id.display_txtLocation);
          txtTitle.setText(displayTitle);
          txtPrice.setText(displayPrice);
  
      }
  </code></pre>
  
  <p><strong>In Activity B</strong> </p>
  
  <pre><code>private class myListAdapter extends ArrayAdapter&lt;Items&gt; {
          public myListAdapter()
          {
              super(ResultActivity.this,R.layout.item_view,itemList);
          }
  
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              String CurrentImage="";
              View itemView = convertView;
              if(itemView == null)
              {
                  itemView = getLayoutInflater().inflate(R.layout.item_view,parent,false);
              }
  
              //populate the list
              //find the item to work with
              final Items CurrentItem = itemList.get(position);
              //fill the view
  
              TextView title =(TextView)itemView.findViewById(R.id.txt_imageTitle);
              title.setText(CurrentItem.GetItemTitle());
  
              CurrentImage = CurrentItem.GetImgUrl();
              ImageView imageView = (ImageView)itemView.findViewById(R.id.item_icon);
              new ImageLoadTask(CurrentImage, imageView).execute();
  
              TextView Price =(TextView)itemView.findViewById(R.id.txt_itemPrice);
              Price.setText(CurrentItem.GetPrice());
  
              title.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
                      Intent intent = new Intent(ResultActivity.this,DisplayActivity.class);
                      Bundle extras = new Bundle();
                      extras.putString("title",CurrentItem.GetItemTitle());
                      extras.putString("price",CurrentItem.GetPrice());
                      extras.putString("basicURL",CurrentItem.GetImgUrl());
                      extras.putString("ImageUrl",CurrentItem.GetImgSuperUrl());
                      extras.putString("BasicInfo",CurrentItem.GetBasicInfo().toString());
                      extras.putString("SellerInfo",CurrentItem.GetSellerInfo().toString());
                      extras.putString("ShippingInfo",CurrentItem.GetShippingInfo().toString());
                      intent.putExtras(extras);
                      startActivity(intent);
                  }
              });
  
              return itemView;
              //return super.getView(position, convertView, parent);
          }
      }
  </code></pre>