Code example for Parcel

Methods: readBooleanArray, readBundle

0
            super(superState);
        } 
 
        private SavedState(Parcel in) {
            super(in);
            Bundle bundle = in.readBundle();
            this.ids = (TreeSet<Long>) bundle.getSerializable("ids");
            this.type = (Type) bundle.getSerializable("type");
            boolean[] disappearArray = new boolean[2];
            in.readBooleanArray(disappearArray);
            this.disappear = disappearArray[0];
            this.visible = disappearArray[1];
        } 
 
        @Override 
        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);