title: FragmentManager replace vs Add
body: <p>In my application there is a <code>FrameLayout</code> on which I am adding various fragments</p>
  
  <pre><code>FragmentManager fm = getSupportFragmentManager();
  FragmentTransaction ft = fm.beginTransaction();
  ft.replace(R.id.fragment_content, fragment, fargmentTag);
  ft.commit();
  </code></pre>
  
  <p>Now it seems when I use the <code>ft.replace(R.id.fragment_content, fragment, fargmentTag);</code> and then in other places call </p>
  
  <pre><code>getSupportFragmentManager().findFragmentByTag(fargmentTag); 
  </code></pre>
  
  <p>I always get <code>null</code>. </p>
  
  <p>However if I use <code>add</code> instead of <code>replace</code> this problem is fixed but another problem appears that each fragment is added ontop of the other fragment and i can see the other fragments below. </p>
  
  <p>I would prefer to use <code>replace</code>, but I need the saved fragment state. Also to be noted I am not using <code>addToBackStack</code>. </p>