title: Why is my back button not working right after dismissing dialog fragment
body: <p>I create a dialog fragment and then when I press back it is dismissed. Unfortunately, when I press the back button again nothing happens (what is supposed to happen is I am supposed to leave this activity and go to previous one). How can that be? When I dismiss the fragment (using either dismiss() or back button) it should not be catching any more of my back button presses (and I am unsure if it does catch that event).</p>
  
  <p>Can anyone say what the error might be?</p>
  
  <p>Code below</p>
  
  <pre><code>FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
  
      Fragment prev = getSupportFragmentManager().findFragmentByTag(
              "File Browser Fragmnent");
      if (prev != null) {
          ft.remove(prev);
      }
      ft.addToBackStack(null);
      FileBrowseDialog dialog = FileBrowseDialog.newInstance(currentVideoId);
      if (dialog.getDialog() != null)
          dialog.getDialog().setCanceledOnTouchOutside(true);
      dialog.setCancelable(true);
  
      if(darkenedOverlay != null &amp;&amp; darkenedOverlay.getVisibility() != View.VISIBLE)
          darkenedOverlay.setVisibility(View.VISIBLE);
      ft.add(dialog, "File Browser Fragmnent");
      ft.show(dialog).commit();
  </code></pre>
  
  <p>Then when I press the back button the dialog fragment disappears (I am unsure if it is just hiding or what)
  Also this only happens when using ft.add() and ft.show().commit();</p>
  
  <p>If I use below code instead of ft.add().show().commit() it works with no problems.</p>
  
  <pre><code>dialog.show(ft, "File Browser Fragment");
  </code></pre>
  
  <p>Hopefully someone here can help, and thanks in advance.</p>