Code example for Parcel

Methods: writeInt, writeParcelable

0
 
    /** 
     * {@inheritDoc} 
     */ 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(decoration, 0);
        dest.writeInt(position);
        dest.writeInt(color);
    } 
 
    /** 
     * Parcelable creator 
     */ 
    public static final Parcelable.Creator<TaskDecoration> CREATOR = new Parcelable.Creator<TaskDecoration>() {
        /** 
         * {@inheritDoc} 
         */ 
        public TaskDecoration createFromParcel(Parcel source) { 
            return new TaskDecoration((RemoteViews)source.readParcelable( 
                    RemoteViews.class.getClassLoader()), 
                    source.readInt(), source.readInt());