I use showDialog and dismissDialog in activity to display and destroy my dialog. Is there also a way to issue a click command on the currently disp
showDialog
dismissDialog
I want to press the 'Ok' / positive button of the dialog via code
Yes, you can do it by getting instance of POSITIVE BUTTON and then call performClick() on it. try it as:
POSITIVE
performClick()
Button okButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE); okButton.performClick(); //<<< click Button using code