title: How can I return to a parent activity correctly?
body: <p>I have 2 activities (A and B) in my android application and I use an intent to get from activity A to activity B. The use of parent_activity is enabled:</p>
  <pre class="lang-xml prettyprint-override"><code> &lt;activity
          android:name=&quot;.B&quot;
          android:label=&quot;B&quot; &gt;
          &lt;meta-data
              android:name=&quot;android.support.PARENT_ACTIVITY&quot;
              android:value=&quot;com.example.app_name.A&quot; /&gt;
    &lt;/activity&gt;
  </code></pre>
  <p>I also use a theme which provides an UP-button.</p>
  <p>So after I called activity B I can use the UP-button to get back to the activity A. The problem is that the application seems to call the <em>onCreate()</em>-function of activity A again and this is not the behaviour I need. I need activity A to look the same way like it looked before I called activity B.</p>
  <p>Is there a way to achieve this?</p>
  <h3>EDIT</h3>
  <p>I didn't write any code to start activity B from activity A. I think it is auto-generated by Eclipse.</p>
  <p>Class B looks like:</p>
  <pre><code>    @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_b);
      getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.activity_b, menu);
      return true;
  }
  
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
          case android.R.id.home:
              NavUtils.navigateUpFromSameTask(this);
              return true;
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>