Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.