Skip to content

Instantly share code, notes, and snippets.

@nontravis
Created January 18, 2017 14:59
Show Gist options
  • Save nontravis/6d02387102d4ff02a67f326311b4453d to your computer and use it in GitHub Desktop.
Save nontravis/6d02387102d4ff02a67f326311b4453d to your computer and use it in GitHub Desktop.
BaseViewGroup_ChildSavedState
abstract public class BaseViewGroup extends FrameLayout{
...
public static abstract class ChildSavedState extends BaseSavedState{
SparseArray childrenStates;
public ChildSavedState( Parcelable superState ){
super( superState );
}
public ChildSavedState( Parcel in, ClassLoader classLoader ){
super( in );
childrenStates = in.readSparseArray( classLoader );
}
@Override
public void writeToParcel( Parcel out, int flags ){
super.writeToParcel( out, flags );
out.writeSparseArray( childrenStates );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment