Created
February 19, 2014 04:40
-
-
Save ymhuang0808/9086148 to your computer and use it in GitHub Desktop.
Station
This file contains 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 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