Using java Syntax Highlighting
- new AlertDialog.Builder(mContext)
- .setTitle("Testing")
- .setMessage("Buy this thing?")
- .setPositiveButton(R.string.yes, yesListener)
- .setNegativeButton(R.string.no, noListener)
- .show();
Parsed in 0.012 seconds, using GeSHi 1.0.8.4
If we pressed the positive button, the program will run the yesListener and run the noListener if we pressed the negative button.
What i want is, if the program met certain condition, the alert dialog will show, and program automatically pressed the positive / negative button.
I don't want to access the method directly, because i want the dialog to be shown first... (it's done as if human pressed the button).
Is it possible?
Thanks,
sasuke