Code example for Parcel

Methods: writeInt, writeIntArray

0
        return 0; 
    } 
 
    @Override 
    public void writeToParcel(Parcel out, int flags) {
        out.writeInt(mKeyDbId);
        out.writeInt(mGroups.length);
        out.writeIntArray(mGroups);
        out.writeIntArray(mPerms);
    } 
 
    public void writeToDB(ContentResolver cr) {
        if(mKeyDbId == Account.NOT_IN_DATABASE){
            Cursor keyCur = cr.query(Database.ACCOUNT_URI,
                    new String[]{Account._ID},
                    Account.COL_KEY+"=?", 
                    new String[]{String.valueOf(mKeyDbId)},
                    null); 
 
            if(keyCur.getCount() == 0){
                keyCur.close();