Code example for ContentValues

Methods: remove

0
		boolean success = false;
 
		ContentValues values = pubkey.getValues();
 
		if (pubkey.getId() > 0) {
			values.remove("_id");
			if (db.update(TABLE_PUBKEYS, values, "_id = ?", new String[] { String.valueOf(pubkey.getId()) }) > 0)
				success = true;
		} 
 
		if (!success) {
			long id = db.insert(TABLE_PUBKEYS, null, pubkey.getValues());
			pubkey.setId(id);
		} 
 
		db.close();
 
		return pubkey;
	} 
}