Мой код, как показано ниже:
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
dialog.setTitle("Dialog");
dialog.setPositiveButton("Check", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
if(condition) {
//set NegativeButton unclickable
} else {
//set NegativeButton clickable
}
} // end of onClick
});
dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
//do something
}
});
Как установить NegativeButton нажатием и не щелкать мышью?