Code example for Parcel

Methods: writeIntwriteString

0
        this.priority = in.readInt();
        this.notification = new Notification(in);
    } 
 
    public void writeToParcel(Parcel out, int flags) {
        out.writeString(this.pkg);
        out.writeInt(this.id);
        if (this.tag != null) {
            out.writeInt(1);
            out.writeString(this.tag);
        } else { 
            out.writeInt(0);
        } 
        out.writeInt(this.uid);
        out.writeInt(this.initialPid);
        out.writeInt(this.priority);
        this.notification.writeToParcel(out, flags);
    } 
 
    public int describeContents() { 
        return 0;