/**
  * Simulates a click on the {@code Dialog} item indicated by {@code index}. Handles both multi-
  * and single-choice dialogs, tracks which items are currently checked and calls listeners
  * appropriately.
  *
  * @param index the index of the item to click on
  */
 public void clickOnItem(int index) {
   if (isMultiItem) {
     checkedItems[index] = !checkedItems[index];
     multiChoiceClickListener.onClick(realAlertDialog, index, checkedItems[index]);
   } else {
     if (isSingleItem) {
       checkedItemIndex = index;
     }
     clickListener.onClick(realAlertDialog, index);
   }
 }
 public void handleMessage(Message paramMessage) {
   switch (what) {
     case 0:
     default:
       return;
     case -3:
     case -2:
     case -1:
       ((DialogInterface.OnClickListener) obj).onClick((DialogInterface) mDialog.get(), what);
       return;
   }
   ((DialogInterface) obj).dismiss();
 }
示例#3
0
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
      case R.id.btn_ok:
        if (okClickListener != null) {
          okClickListener.onClick(alertDialog, 0);
        }

        break;

      default:
        break;
    }
  }
示例#4
0
 /** M: the process of click OK button on dialog */
 @Override
 public void onClick(DialogInterface arg0, int arg1) {
   if (null != mClickListener) {
     mClickListener.onClick(arg0, arg1);
   }
 }
示例#5
0
 private void startNewRoute(final DialogInterface.OnClickListener listener) {
   if (Route.available() && CycleStreetsPreferences.confirmNewRoute())
     MessageBox.YesNo(mapView(), R.string.confirm_new_route, listener);
   else listener.onClick(null, 0);
 } // startNewRoute
示例#6
0
 @Override
 public void onDismiss(DialogInterface dialog) {
   listener.onClick(null, DialogInterface.BUTTON_NEGATIVE);
   super.onDismiss(dialog);
 }