title: Opening Fragment from a DialogFragment (replacing the Dialogs parent)
body: <p>Let's say I have Fragment A, from which I open a <code>DialogFragment</code> like this:</p>
  <pre><code>FragmentActivity fragmentActivity = (FragmentActivity) view.getContext();
  FragmentTransaction ft = fragmentActivity.getSupportFragmentManager().beginTransaction();
  Fragment prev = fragmentActivity.getSupportFragmentManager().findFragmentByTag(&quot;dialog&quot;);
  if (prev != null) {
    ft.remove(prev);
  }
  ft.addToBackStack(null);
  DialogFragment fragmentDialog = MyDialogFragment.newInstance();
  fragmentDialog.show(ft, &quot;dialog&quot;);
  </code></pre>
  <p>From this Dialog, after clicking (positive / neutral / negative) button, I want to open Fragment B, which should replace Fragment A.</p>
  <p>In the Dialog's onClick method I run a callback method of parent Activity:</p>
  <pre><code>@Override
  public void onClick(DialogInterface dialog, int which) {
    switch(which) {
      case DialogInterface.BUTTON_NEUTRAL:
        detailsCallbacks.openMoreDetails(); 
        break;
    }
  }
  </code></pre>
  <p>And finally my Activity's <code>openMoreDetails()</code> method looks like this:</p>
  <pre><code>@Override
  public void openMoreDetails() {
    Fragment fragmentB = Fragment.newInstance();
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.replace(R.id.fragment_container, fragmentB);
    ft.addToBackStack(null);
    ft.commit();
  }
  </code></pre>
  <p>What I get is strange. Fragment B blinks on the screen just for a fraction of a second and then is replaced (covered?) by Fragment A again.</p>
  <p>When I click the 'up' button I get back from Fragment A, so none of these transactions were added to the back stack. I would like to show Fragment B and then, when pressing the 'up' button, go back to Fragment A.</p>
  <p>Is it somehow possible? And what's wrong with my approach?</p>