Code example for Parcel

Methods: createStringArray

0
public class MultiSelectListPreference extends DialogPreference {
    private static class SavedState extends BaseSavedState {
        Set<String> values;
 
        public SavedState(Parcel source) {
            super(source);
            String[] v = source.createStringArray();
            values = new HashSet<String>(Arrays.asList(v));
        } 
 
        public SavedState(Parcelable superState) {
            super(superState);
        } 
 
        @Override 
        public void writeToParcel(Parcel dest, int flags) {
            super.writeToParcel(dest, flags);
            dest.writeStringArray(values.toArray(new String[values.size()]));
        } 
    }