title: FragmentTransaction::replace() with or without addToBackStack()
body: <p>Having a flow to add fragment and later <code>replace()</code> fragment. All fragment are dynamically added, but not all call <code>addToBackStack()</code>.</p>
  
  <pre><code>getSupportFragmentManager().beginTransaction()
      .add(R.id.frgment_holder, frgmtA, frgmtA.NAME)
      .commit();
  </code></pre>
  
  <p>and in somewhere it could add another, like:</p>
  
  <pre><code>getSupportFragmentManager().beginTransaction()
      .replace(R.id.frgment_holder, frgmtB)
      .addToBackStack(frgmtB.NAME)
      .commit();
  </code></pre>
  
  <p>the <code>replace()</code> with the frgmtB will remove the frgmtA from the container R.id.frgment_holder.
  if press back button at this state, it will pop the frgmtB. But will it recreate the frgmtA even if it did not call <code>addToBackStack()</code> when did the adding? </p>
  
  <p>if in the flow of adding fragment into same container with a serials mixed add() and replace() calls, and someone call <code>addToBackStack()</code> but someone do not, how would the back button behavior? </p>
  
  <p>EDIT:
  after </p>
  
  <pre><code>getSupportFragmentManager().beginTransaction()
          .replace(R.id.frgment_holder, frgmtB)
          .addToBackStack(frgmtB.NAME)
          .commit();
  </code></pre>
  
  <p>will the </p>
  
  <pre><code>getSupportFragmentManager().findFragmentByTag(frgmtA.NAME);
  </code></pre>
  
  <p>still find the the frgmtA? what if when add frgmtA also called addToBackStack();</p>
  
  <p>The doc says "This first searches through fragments that are currently added to the manager's activity; if no such fragment is found, then all fragments currently on the back stack are searched."</p>
  
  <p>The case would be </p>
  
  <ol>
  <li>adding frgmtA; not call add to stack; UI state changed here;</li>
  </ol>
  
  <p>(what if the frgmtA is not dynamically added by add(), but sepcified in layout file with class="frgmtA"?).</p>
  
  <ol start="2">
  <li><p>replace() with frgmtB; addToStack();</p></li>
  <li><p>replace() with frgmtC; addToStack();</p></li>
  </ol>
  
  <p>then if the stackTop is frgmtC, would like the back button press to bring back the first frgmtA with its last UI state.</p>