title: Home/back button intent causes error because of losing intent extras
body: <p>I use a simple intent to start a new activity and it automatically creates a home/backbutton. When I press this button it is suppose to return to the activity which called the new activity. This activity is missing information when I press this button because this one is also created from a intent. The device backbutton does the job right.</p>
  
  <p>So it looks like this MainActivity > SearchResultActivity > InfoResultActivity</p>
  
  <p>I can go back with the button from SearchResultsActivity to MainActivity because it doesn't require information in the onCreate. SearchResultActivity needs information from MainActivity.</p>
  
  <p>MainActivity</p>
  
  <pre><code>button.setOnClickListener(new View.OnClickListener()
  {
      public void onClick(View v)
      {
          // Perform action on click
          String selectedVillage = villagesSpinner.getSelectedItem().toString();
          String selectedTheme = themesSpinner.getSelectedItem().toString();
          String selectedRestaurant = autocompletetextview.getText().toString();
          Log.w("tag", "" + selectedVillage + " " + selectedTheme + " " + selectedRestaurant + " " + afhaalCheck.isChecked() + " " + bezorgCheck.isChecked() + " " + uitetenCheck.isChecked());
  
          Intent myIntent = new Intent(MainActivity.this, SearchResultActivity.class);
          for(int i = 0; i &lt; allFeeds.size(); i++)
          {
              if(allFeeds.get(i).name.equals(selectedTheme))
              {
                  myIntent.putExtra("THEME_SEARCH", allFeeds.get(i).idNumb);
              }
          }
          myIntent.putExtra("VILLAGE_SEARCH", selectedVillage);
          myIntent.putExtra("RESTAURANT_SEARCH", selectedRestaurant);
          myIntent.putExtra("AFHAAL_CHECK", afhaalCheck.isChecked());
          myIntent.putExtra("BEZORG_CHECK", bezorgCheck.isChecked());
          myIntent.putExtra("UITETEN_CHECK", uitetenCheck.isChecked());
          startActivity(myIntent);
      }
  });
  </code></pre>
  
  <p>Here I send the information to SearchResultActivity</p>
  
  <p>SearchResultActivity</p>
  
  <pre><code>    @Override
      protected void onCreate(Bundle savedInstanceState)
      {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_searchresult);
  
              //Given values from search
               village = getIntent().getExtras().getString("VILLAGE_SEARCH");
               restaurant = getIntent().getExtras().getString("RESTAURANT_SEARCH");
               theme = getIntent().getExtras().getInt("THEME_SEARCH");
               afhaal = getIntent().getExtras().getBoolean("AFHAAL_CHECK");
               bezorg = getIntent().getExtras().getBoolean("BEZORG_CHECK");
               uiteten = getIntent().getExtras().getBoolean("UITETEN_CHECK");
  
  ....
  ....
  ....
  
              listView.setOnItemClickListener(new OnItemClickListener() {
                  @Override
                  public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id)
                  {
                      Intent myIntent = new Intent(SearchResultActivity.this, InfoActivity.class);
                      myIntent.putExtra("RESTAURANT_CLICKED", displayData[position].name);
                      myIntent.putExtra("RESTAURANT_SEARCHED", restaurant);
                      myIntent.putExtra("THEME_SEARCH", theme);
                      myIntent.putExtra("VILLAGE_SEARCH", village);
                      myIntent.putExtra("AFHAAL_CHECK", afhaal);
                      myIntent.putExtra("BEZORG_CHECK", bezorg);
                      myIntent.putExtra("UITETEN_CHECK", uiteten);
                      startActivityForResult(myIntent,0);
                  }
              });
  .....
  ....
  </code></pre>
  
  <p>Here I send the search info and the name of the clicked listView item to InfoActivity to let it know what to display.</p>
  
  <p>Now in InfoActivity I tried to use the finish() method to send things back but it doesnt work for the home/backbutton. The problem is that finish() is not called when I press the home/backbutton.</p>
  
  <p>InfoActivity</p>
  
  <pre><code>@Override
  public void finish()
  {
      // Prepare data intent
      Intent myIntent = new Intent();
      myIntent.putExtra("THEME_SEARCH", getIntent().getExtras().getString("THEME_SEARCH"));
      myIntent.putExtra("VILLAGE_SEARCH", getIntent().getExtras().getString("VILLAGE_SEARCH"));
      myIntent.putExtra("RESTAURANT_SEARCH", getIntent().getExtras().getString("RESTAURANT_SEARCH"));
      myIntent.putExtra("AFHAAL_CHECK",getIntent().getExtras().getString("AFHAAL_CHECK") );
      myIntent.putExtra("BEZORG_CHECK", getIntent().getExtras().getString("BEZORG_CHECK"));
      myIntent.putExtra("UITETEN_CHECK",getIntent().getExtras().getString("UITETEN_CHECK") );
      // Activity finished ok, return the data
      setResult(RESULT_OK, myIntent);
      super.finish();
  }
  </code></pre>