title: How do I save instance of List<Fragments>
body: <p>I have a ArrayList of Fragments :  <code>ArrayList&lt;Fragment&gt; arrayList;</code></p>
  <p><strong>I want to save the instance of Fragments List when I change orientation on Android Studio. How do I do so?</strong></p>
  <p>I tried to do this on OnSaveInstanceState method:</p>
  <pre><code>outState.putParcelableArrayList(C_KEY, (ArrayList&lt;? extends Parcelable&gt;) arrayList);
  </code></pre>
  <p>but on my onCreate method:</p>
  <pre><code>arrayList = (ArrayList&lt;Fragment&gt;) savedInstanceState.getParcelableArrayList(C_KEY);
  </code></pre>
  <p>does not work because of the error:Inconvertible types; cannot cast 'java.util.ArrayList&lt;android.os.Parcelable&gt;' to 'java.util.ArrayList&lt;androidx.fragment.app.Fragment&gt;</p>