Code example for Parcel

Methods: writeByteArray, writeInt, writeMap, writeString

0
    public void setClientType(int clientType) {
        mClientType = clientType;
    } 
 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mStatus);
        dest.writeString(mStatusText);
        dest.writeByteArray(mAvatarData);
        dest.writeString(mAvatarType);
        dest.writeInt(mClientType);
        dest.writeMap(mExtendedInfo);
        dest.writeString(mResource);
    } 
 
    public int describeContents() { 
        return 0; 
    } 
 
    public static final Parcelable.Creator<Presence> CREATOR = new Parcelable.Creator<Presence>() {
        public Presence createFromParcel(Parcel source) { 
            return new Presence(source);