Code example for Parcel

Methods: readInt, readParcelable, readString

0
        this.text = text;
        this.icon = null;
    } 
 
    public Item(Parcel in) {
        id = in.readInt();
        text = in.readString();
        icon = in.readParcelable(null);
    } 
 
    public int describeContents() { 
        return 0; 
    } 
 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(text);
        dest.writeParcelable(icon, flags);
    } 
 
    public static final Parcelable.Creator<Item> CREATOR = new Parcelable.Creator<Item>() {