Skip to content

Instantly share code, notes, and snippets.

@matthew-carroll
Created July 6, 2019 11:10
Show Gist options
  • Save matthew-carroll/a12905077bc309847401fb01757746b6 to your computer and use it in GitHub Desktop.
Save matthew-carroll/a12905077bc309847401fb01757746b6 to your computer and use it in GitHub Desktop.
Implements Parcelable in a custom View in Android (2/4).
public class MyView extends View {
private static class SavedState extends BaseSavedState {
String name;
int index;
SavedState(Parcelable superState) {
super(superState);
}
private SavedState(Parcel in) {
super(in);
name = in.readString();
index = in.readInt();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment