Example #1
0
    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();
    }
Example #2
0
    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();
    }