Code example for Parcel

Methods: writeDouble, writeFloat, writeInt, writeLong

0
        return 0; 
    } 
     
    public void writeToParcel(final Parcel out, final int flags) {
         
        out.writeInt(_resourceId);
        out.writeInt(_photoId);
        out.writeDouble(lat);
        out.writeDouble(lng);
//        out.writeDouble(alt); 
        out.writeLong(_date);
        if (thumbUri != null) {
            out.writeInt(1);
            thumbUri.writeToParcel(out, 0);
        } else { 
            out.writeInt(0);
        } 
         
        if (_geoPoint != null) {
            out.writeInt(1);
            out.writeInt(_geoPoint.getLatitudeE6());
            out.writeInt(_geoPoint.getLongitudeE6());
        } else { 
            out.writeInt(0);
        } 
        out.writeInt(origWidth);
        out.writeInt(origHeight);
        out.writeFloat(distance);
        out.writeDouble(direction);
//        out.writeDouble(altOffset); 
         
        out.writeDouble(_lastUpdateLat);
        out.writeDouble(_lastUpdateLng);
//        out.writeDouble(_lastUpdateAlt); 
    } 
     
     
    public static final Parcelable.Creator<Photo> CREATOR = new Parcelable.Creator<Photo>() {