Code example for Parcel

Methods: writeDoublewriteString

0
        return 0; 
    } 
     
    @Override 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeDouble(quantity);
        dest.writeString(unit);
    } 
    @Override 
    public int compareTo(Ingredient another) {
        return name.compareTo(another.getName());
    } 
 
}