I have a ArrayList< Fragments could group; Fragment> ArrayList.
When the screen rotation or exit the arrayList to save
I want to save in OnSaveInstanceState parcelable
OutState. PutParcelableArrayList (C_KEY, (ArrayList<? Extends Parcelable>) ArrayList);
But in OnCreate
ArrayList=(ArrayList
Can't use,
Error: Inconvertible types; Always cast a 'Java. Util. ArrayList
If I want to save the entire Fragments could set me to want what?
CodePudding user response:
What is this strange? Why do you want to save the fragments? Save the corresponding data line.Persistence is the premise of serialization, or implement the Serializable, or implement Parcelable, apparently fragments did not