Trying to dynamically change the message of an AlertDialog. For some reason I get a blank dialog box with no message.
@Override
protected Dialog onCreateDialog(int dialogId, Bundle args) {
switch (dialogId) {
case ABOUT_DIALOG:
AlertDialog.Builder aboutDialog = new AlertDialog.Builder(this);
return aboutDialog.create();
}
}
@Override
protected void onPrepareDialog(int dialogId, Dialog dialog, Bundle args){
super.onPrepareDialog(dialogId, dialog, args);
switch(dialogId){
case ABOUT_DIALOG:
AlertDialog aboutDialog = (AlertDialog) dialog;
aboutDialog.setMessage("hello world");
}
}
How can I dynamically change the content of an Alert Dialog?