Blog Archive

Android SQLite update example code

Sample code snippet...
public boolean update(Customer customer) {

        ContentValues args = new ContentValues();
        args.put(KEY_STATUS, inspection.getStatusCode());

        return mDb.update(SQLITE_TABLE, args, 
                KEY_COMPANY + "=?" + " and "  +
                KEY_CUSTOMER + "=?",  
                new String[] {
                inspection.getCompany(),
                inspection.getCustomer()}) > 0;
    }

3 comments :