Code example for CursorAdapter

Methods: getItemId

0
  protected void onPrepareDialogBuilder(final Builder builder) {
    builder.setSingleChoiceItems(adapter, -1, new DialogInterface.OnClickListener() {
 
      @Override 
      public void onClick(final DialogInterface dialog, final int which) {
        calendarId = adapter.getItemId(which);
        CalendarListPreference.this.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
        dialog.dismiss();
      } 
    }); 
    builder.setPositiveButton(null, null);
  } 
 
  @Override 
  protected void onDialogClosed(final boolean positiveResult) {
    super.onDialogClosed(positiveResult);
    String strVal = Long.toString(calendarId);
    if (positiveResult && callChangeListener(strVal)) {
      setValue(strVal);
      updateSummary(); 
    }