Skip to content

Instantly share code, notes, and snippets.

@ymhuang0808
Created February 19, 2014 04:40
Show Gist options
  • Save ymhuang0808/9086148 to your computer and use it in GitHub Desktop.
Save ymhuang0808/9086148 to your computer and use it in GitHub Desktop.
Station
public class Station implements Parcelable {
private int mId;
private int mNo;
private String mName;
public Station() {
}
// getters and setters...
@Override
public int describeContents() {
return 0;
}
private void readFromParcel(Parcel in) {
mId = in.readInt();
mNo = in.readInt();
mName = in.readString();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mId);
dest.writeInt(mNo);
}
private Station(Parcel in) {
readFromParcel(in);
}
public static final Parcelable.Creator<Station> CREATOR = new Parcelable.Creator<Station>() {
@Override
public Station createFromParcel(Parcel source) {
return new Station(source);
}
@Override
public Station[] newArray(int size) {
return new Station[size];
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment