Code example for Parcel

Methods: writeBooleanArray, writeBundle

0
        public void writeToParcel(Parcel out, int flags) {
            super.writeToParcel(out, flags);
            Bundle bundle = new Bundle();
            bundle.putSerializable("ids", ids);
            bundle.putSerializable("type", type);
            out.writeBundle(bundle);
            out.writeBooleanArray(new boolean[]{this.disappear, this.visible});
        } 
 
        //required field that makes Parcelables from a Parcel 
        public static final Parcelable.Creator<SavedState> CREATOR =
                new Parcelable.Creator<SavedState>() { 
                    public SavedState createFromParcel(Parcel in) { 
                        return new SavedState(in); 
                    } 
 
                    public SavedState[] newArray(int size) { 
                        return new SavedState[size]; 
                    } 
                }; 
    }