Code example for Parcel

Methods: writeDouble, writeLong, writeParcelable, writeString

0
    public int describeContents() { 
        return 0; 
    } 
 
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable((Parcelable) this.getAttribute(), flags);
        out.writeLong(getLastUpdated().getTime());
        out.writeString((originType == null) ? "" : originType.name());
        out.writeDouble(precision);
        out.writeDouble(updateFrequency);
    } 
 
    public static final Parcelable.Creator<ACtxQuality> CREATOR
            = new Parcelable.Creator<ACtxQuality>() { 
        public ACtxQuality createFromParcel(Parcel in) { 
            return new ACtxQuality(in); 
        } 
 
        public ACtxQuality[] newArray(int size) { 
            return new ACtxQuality[size]; 
        }