Issue with getSupportFragmentManager().putFragment
<p>I am developing an android application and I want to save my fragment that is in the vector fragments. When I use putFragment in onSaveIstanceState the system throw IllegalStateException</p>

<pre><code>@Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        // Salviamo lo stato 


        //salvo all fragment
        for(int i=0;i&lt;fragments.size();i++)
            getSupportFragmentManager().putFragment(outState, Integer.toString(i), fragments.get(i));

    }
</code></pre>

<p>This is the logcat :</p>

<pre><code>09-13 10:38:10.230: E/AndroidRuntime(24089): java.lang.IllegalStateException: Fragment GenericPageFragment{417716e0} is not currently in the FragmentManager
09-13 10:38:10.230: E/AndroidRuntime(24089):    at android.support.v4.app.FragmentManagerImpl.putFragment(FragmentManager.java:516)
09-13 10:38:10.230: E/AndroidRuntime(24089):    at it.intects.dashboard.droid.BaseActivity.onSaveInstanceState(BaseActivity.java:180)
09-13 10:38:10.230: E/AndroidRuntime(24089):    at android.app.Activity.performSaveInstanceState(Activity.java:1113)
09-13 10:38:10.230: E/AndroidRuntime(24089):    at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1188)
</code></pre>

<p>Why ? How can I resolve this error ?</p>
