title: Nested fragment not getting removed completely
body: <p>In my activity, I have various fragments. By default activity displays a map. On listitem click, Fragment A, B or C is displayed using following code:</p>
  
  <pre><code>protected void replaceFragment(int i) {
      FragmentManager fragmentManager = getFragmentManager();
      android.app.FragmentTransaction fragmentTransaction = fragmentManager
              .beginTransaction();
      switch (i) {
      case FRAGMENT_A:
          aFragment = new AFragment ();
          fragmentTransaction.replace(R.id.main_framelayout_replace,
                  aFragment , TAG_A_FRAGMENT);
          fragmentTransaction.commit();
          break;//and so on.....
       default:
          break;
      }
  }
  </code></pre>
  
  <p>Here I'm facing an issue: When I replace Fragment A with Fragment B which is nested fragment i.e. it contains list and detail fragment within itself. When I try to remove any fragment other than Fragment B, I'm able to do it successfully and show the default map screen but when I'm on Frgament B and try to remove it, I'm not able to see default map screen. Instead a blank white screen is getting displayed.</p>
  
  <p>Removing of fragments is done as follows:</p>
  
  <pre><code>if (aFragment != null) {
                          fragmentManager.beginTransaction()
                                  .remove(aFragment ).commit();
                      }//and so on...
  </code></pre>
  
  <p>For fragment B which is having list and detailed fragment, I also do following in onDetach of fragment B,</p>
  
  <pre><code>fragmentManager.beginTransaction()
                      .remove(MainActivity.listFragment).commit();
  </code></pre>
  
  <p>Note: I'm not getting exception in any try catch. All the lines of code are getting executed without error including onDetach of Fragment B.</p>
  
  <p>Am I doing anything wrong here? Any help appreciated.</p>