title: How can I update multi select in android dialog window
body: <p>I have been unable to find a tutorial helping with multi-selects using cursors. As of right now my logic is working the way I want but the check boxes will not update properly. What am I overlooking?</p>
  
  <pre><code>return new AlertDialog.Builder(this).setTitle("Items")
              .setMultiChoiceItems(cur, CHECK, EDATE, new DialogInterface.OnMultiChoiceClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int position, boolean checked)
                  {
                      DBM.open();
                      AlertDialog AD = (AlertDialog) dialog;
                      ListView list = AD.getListView();
                      list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  
                      itemCur = (Cursor) list.getItemAtPosition(position);
  
                      if (checked)
                      {
                          //update query
                          DBM.setChecked(checkCur.getInt(checkCur.getColumnIndex(ID)), itemId, userId, 1);
                          list.setItemChecked(1, true);
                      } else
                      {
                          DBM.setChecked(checkCur.getInt(checkCur.getColumnIndex(ID)), itemId, userId, 0);
                          list.setItemChecked(1, false);
                      }
                      DBM.close();
                  }
              }).setPositiveButton("OK", new DialogButtonClickHandler()).create();
  </code></pre>