Ejemplo n.º 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();
    }
Ejemplo n.º 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();
    }