Code example for Parcel

Methods: createIntArray, readInt, readString

0
	 
	public static Parcelable.Creator<MetricQuery> CREATOR = new Parcelable.Creator<MetricQuery>() {
        @Override 
        public MetricQuery createFromParcel(Parcel source) { 
            MetricQuery q = new MetricQuery(); 
            q.name=source.readString(); 
            q.unit=source.readString(); 
            q.scale=source.readInt(); 
            q.object=source.readString(); 
            q.values=source.createIntArray(); 
            return q; 
        } 
        @Override 
        public MetricQuery[] newArray(int size) { 
            return new MetricQuery[size]; 
        } 
	}; 
	 
	public String name;
    public String unit;
    public int scale;