Created
July 21, 2014 15:23
-
-
Save lenamuit/e771dc8d52557f394da2 to your computer and use it in GitHub Desktop.
MyParcelable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyParcelable implements Parcelable { | |
| private int mData; | |
| public int describeContents() { | |
| return 0; | |
| } | |
| public void writeToParcel(Parcel out, int flags) { | |
| out.writeInt(mData); | |
| } | |
| public static final Parcelable.Creator<MyParcelable> CREATOR | |
| = new Parcelable.Creator<MyParcelable>() { | |
| public MyParcelable createFromParcel(Parcel in) { | |
| return new MyParcelable(in); | |
| } | |
| public MyParcelable[] newArray(int size) { | |
| return new MyParcelable[size]; | |
| } | |
| }; | |
| private MyParcelable(Parcel in) { | |
| mData = in.readInt(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment