title: Need to press back button twice to navigate back from activity
body: <p>I have a main activity A (PlacesListActivity). It calls activity B (AboutMeActivity) from the navigation drawer. I have declared activity A as the parent activity of B in manifest.</p>
  
  <p>Now, when I go from A->B,</p>
  
  <ul>
  <li><p>if i press the back arrow in action bar, it takes me back to the activity A.</p></li>
  <li><p>regarding the hardware button, I have to press it twice to go back to activity A. When I press hardware back once, nothing happens. It seems like it just reloads activity B. 
  I don't want this. Pressing hardware button once should do the job.</p></li>
  </ul>
  
  <p>Code for activity B : </p>
  
  <pre><code> @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_about_me);
      initialize();
  }
  
   private void initialize() {
      toolbar = (Toolbar) findViewById(R.id.toolbarAboutMe);
      setSupportActionBar(toolbar);
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
     .....
   }
  </code></pre>
  
  <p>initialize function just initializes some UI elements.</p>
  
  <p>Code for calling activity B :</p>
  
  <pre><code>@Override
  public void onDrawerItemSelected(View view, int position) {
      Intent i;
      switch (position) {
          case 0:
              i = new Intent(this, AboutMeActivity.class);
              startActivity(i);
              break;
              ......
  </code></pre>
  
  <p>Manifest : </p>
  
  <pre><code>&lt;activity
          android:name="....AboutMeActivity"
          android:parentActivityName="....PlacesListActivity"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="....PlacesListActivity" /&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>Edit : </p>
  
  <p>I have tried with overriding <code>OnBackPressed()</code>, but it never gets called.</p>
  
  <p>tried with overriding <code>OnKeyDown()</code> and calling <code>finish()</code> in that, but still, I have to press it twice to go back to activity A.</p>