Code example for Parcel

Methods: readInt, readString

0
        mId = id;
        mName = name;
    } 
 
    public SampleDBEntity(Parcel source) {
        mId = source.readInt();
        mName = source.readString();
    } 
 
    @Override 
    public int describeContents() { 
        return 0; 
    } 
 
    @Override 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mId);
        dest.writeString(mName);
    } 
 
    public int getId() {