Code example for Parcel

Methods: writeSerializablewriteString

0
    /** 
     * Implement the Parcelable interface. 
     * Method to serialize a OperatorInfo object. 
     */ 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(operatorAlphaLong);
        dest.writeString(operatorAlphaShort);
        dest.writeString(operatorNumeric);
        dest.writeSerializable(state);
    } 
 
    /** 
     * Implement the Parcelable interface 
     * Method to deserialize a OperatorInfo object, or an array thereof. 
     */ 
    public static final Creator<OperatorInfo> CREATOR =
        new Creator<OperatorInfo>() { 
            public OperatorInfo createFromParcel(Parcel in) { 
                OperatorInfo opInfo = new OperatorInfo( 
                        in.readString(), /*operatorAlphaLong*/ 
                        in.readString(), /*operatorAlphaShort*/