title: Android SQL update query returns 1 but not updating
body: <p>I'm trying to update a simple boolean value in an SQL table as per the docs here: <a href="https://developer.android.com/training/basics/data-storage/databases.html#UpdateDbRow" rel="nofollow noreferrer">Updating DB Row, developer.android.com</a></p>
  
  <p>When I attempt to update the table, the update statement returns 1 but after closing and re-opening the app the database remains unchanged. Here is the code:</p>
  
  <p><em>In MainActivity.java:</em></p>
  
  <pre><code> void CheckUncheckTodayTask (String taskID, boolean newState) {
      new CheckUncheckTodayTask().execute(taskID, String.valueOf(newState));
   }
  
   class CheckUncheckTodayTask extends AsyncTask&lt;String, Void, Void&gt; {
  
      @Override
      protected Void doInBackground(String... strings) {
          SQLiteDatabase db = mDbHelper.getReadableDatabase();
  
          // New value for one column
          ContentValues values = new ContentValues();
          values.put(TaskContract.TodayTask.COLUMN_NAME_COMPLETED, Boolean.valueOf(strings[1]));
  
          // Which row to update, based on the title
          String selection = TaskContract.TodayTask._ID+ " = ?";
          String[] selectionArgs = { strings[0] };
  
          db.update(
                  TaskContract.TodayTask.TABLE_NAME,
                  values,
                  selection,
                  selectionArgs);
  
          return null;
      }
  
  }
  </code></pre>
  
  <p><em>In TodayTaskAdapter.java:</em></p>
  
  <pre><code>mCompletedCheckBox = (CheckBox) view.findViewById(R.id.cb_today_completed);
  mCompletedCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
      @Override
      public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
          if (isChecked) {
              mCompletedCheckBox.setPaintFlags(mCompletedCheckBox.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
              mCompletedCheckBox.setTextColor(Color.GRAY);
              ((MainActivity)activityContext).CheckUncheckTodayTask(String.valueOf((long)mCompletedCheckBox.getTag(R.id.tag_check_box)), true);
          } else {
              mCompletedCheckBox.setPaintFlags(mCompletedCheckBox.getPaintFlags() &amp; (~ Paint.STRIKE_THRU_TEXT_FLAG));
              mCompletedCheckBox.setTextColor(Color.BLACK);
              ((MainActivity)activityContext).CheckUncheckTodayTask(String.valueOf((long)mCompletedCheckBox.getTag(R.id.tag_check_box)), false);
          }
      }
  });
  </code></pre>
  
  <p>The click handler is indeed being called and passing a taskID value of 1 and a newState value of true when checked.</p>
  
  <p>I have tried changing to using getWriteableDatabase, using LIKE instead of = in the where clause, and stepping through the code line-by-line, but no errors were thrown.</p>
  
  <p>Thanks!</p>