I asked this question yesterday (http://stackoverflow.com/questions/7392321/how-do-you-disable-a-button-inside-of-an-alertdialog) and modified my code accordingly... this mornin
The trick is that you need to use the AlertDialog
object retuned by AlertDialog.Builder.show()
method. No need to call AlertDialog.Builder.create()
.
Example:
AlertDialog dialog = alertbox.show();
if(monsterint > playerint) {
Button button = dialog.getButton(AlertDialog.BUTTON_NEUTRAL);
button.setEnabled(false);
}