public void delete(Host host) { if (host.getId() < 0) return; SQLiteDatabase db = getWritableDatabase(); db.delete(TABLE_HOSTS, "_id = ?", new String[] {String.valueOf(host.getId())}); db.close(); }
public void update(Host host) { SQLiteDatabase db = getReadableDatabase(); ContentValues values = host.getValues(); db.update(TABLE_HOSTS, values, "_id =?", new String[] {String.valueOf(host.getId())}); db.close(); }