Skip to content

Instantly share code, notes, and snippets.

@yccheok
Created February 6, 2024 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yccheok/b107d7824576cf179ecc1d3ecba1856f to your computer and use it in GitHub Desktop.
Save yccheok/b107d7824576cf179ecc1d3ecba1856f to your computer and use it in GitHub Desktop.
public enum FragmentType implements Parcelable {
Notes,
Archive,
Trash,
Backup;
public static final Parcelable.Creator<FragmentType> CREATOR = new Parcelable.Creator<FragmentType>() {
public FragmentType createFromParcel(Parcel in) {
return FragmentType.valueOf(in.readString());
}
public FragmentType[] newArray(int size) {
return new FragmentType[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeString(this.name());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment