title: Android sqlite update table always return 0
body: <p>I have seen several questions here related to updating in sqlite, but not able to solve this problem. I am unable to update table, it always give 0;</p>
  
  <pre><code>public void onCreate(SQLiteDatabase db) {
      try{
      db.execSQL(createTable);
      db.execSQL(createQuestionTable);
      populateQuestionTable(db);
      }
  
      catch( SQLException e)
      {
          e.printStackTrace();
      }
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
      db.execSQL("DROP TABLE IF EXISTS alarms" );
      onCreate(db);
  
  }
  </code></pre>
  
  <p>I am able to insert and fetch data, but there is only problem in updating it.</p>
  
  <pre><code>public int updateTable( int r )
  {
      String row = String.valueOf(r);
      Log.d("mydb", "disbale alarm" + " " + row);
      SQLiteDatabase db = this.getWritableDatabase();
      ContentValues values = new ContentValues();
      values.put(isDisable, 1);
  
      int result = 0;
      try{
       result = db.update("alarms", values,  keyId+" = ? " ,new String[]{row});
      Log.d("result", ""+result);
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
  
      db.close();
  
      return result;
  }
  </code></pre>
  
  <p>P.S. I have also tried execSql()</p>