title: Trying to update values of an SQLite database from an Android app
body: <p>Using the following code I can't upgrade the data in the database:</p>
  
  <pre><code>public void modification(int pos) {
      AdminSQLiteOpenHelper admin = new AdminSQLiteOpenHelper(this,
              "administracion", null, 1);
      SQLiteDatabase db = admin.getWritableDatabase();
      ContentValues record = new ContentValues();
      record.put(AdminSQLiteOpenHelper.ALARM_HOUR, alarmList.get(pos).getHour());
      record.put(AdminSQLiteOpenHelper.ALARM_DATE, alarmList.get(pos).getDate());
      record.put(AdminSQLiteOpenHelper.ALARM_ACTIVE, 1);
      int numOfRows = db.update("alarm", record, "id=" + alarmList.get(pos).getId(), null);
      db.close();
  
  }
  </code></pre>
  
  <p>The method <code>update</code> is returning 0 when it should return the number of rows affected and I have already checked that the id I put in the method exists in the database. It should return 1.
  ¿Does anyone know where is my mistake?
  Thanks in advance</p>