title: Retain getChildFragmentManager navigation stack after removing and re-adding fragment
body: <p>I have activity:</p>
  
  <pre><code>`&lt;RelativeLayout&gt;
      &lt;FrameLayout
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/&gt;
      &lt;Button/&gt;
      &lt;Button/&gt;
  &lt;/RelativeLayout&gt;`
  </code></pre>
  
  <p>Inside this container, depending on which button pressed appear FragmentA or FragmentB. These fragments are <strong><em>containers</em></strong> for nested child-fragments. I.e. in each fragment contains its own navigation stack.</p>
  
  <p>In onCreate of Activity I instantiate these 2 fragments:</p>
  
  <p><code>fragmentA = (FragmentContainer) Fragment.instantiate(this, FragmentContainer.class.getName());
  fragmentB = (FragmentContainer) Fragment.instantiate(this, FragmentContainer.class.getName());</code></p>
  
  <p>Then, I'm continue replacing one each other:</p>
  
  <p><code>final FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction()
                  .replace(R.id.container, fragment);
                  .commitAllowingStateLoss();</code></p>
  
  <p>So far, so good, everything is working. BUT</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>Every time I replace fragmentA by fragmentB (and vice verse) - <strong>getChildFragmentManager()</strong> destroy its navigation stack and fragmentA/B starts every time from scratch, not with the nested fragment it contained before being replaced.</p>
  
  <p>Any ideas? Is it doable, at least?
  Have a brilliant day,
  Konstantin</p>