"This can only be used with fragments not in the back stack" what does it mean?
<p>I see on Android document that : </p>

<blockquote>
  <p>public void setRetainInstance (boolean retain)</p>
  
  <p>Since: API Level 11
  Control whether a fragment instance is retained across Activity re-creation (such as from a >configuration change). <strong>This can only be used with fragments not in the back stack</strong>. If set, >the fragment lifecycle will be slightly different when an activity is recreated:</p>
</blockquote>

<p>Could anyone explain me more about "This can only be used with fragments not in the back stack".
I build a simple example to test. 
I put the fragment to back stack. But setRetainInstance method still have effect. I put fragment to backstack like this :</p>

<pre><code>    FragmentTransaction transaction2 = getSupportFragmentManager().beginTransaction();

    MyFragment myFragment = new MyFragment();
    myFragment.setHasOptionsMenu(true);
    transaction2.replace(R.id.fragment_container, myFragment);
    transaction2.addToBackStack(null);
    transaction2.commit();
</code></pre>

<p>And in my fragment oncreate method :</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setRetainInstance(true);

    Log.v("MyFragment", "onCreate");
}
</code></pre>

<p>I am newbie in Fragment. Please help me figure out this problem.
Note : I used : SherlockFragment</p>
