I currently have this:
Builder yesandno = new AlertDialog.Builder(this);
yesandno.setTitle("QuickResponse");
yesandno.setMessage(message);
yesandno.setPositiveButton("YES", null);
yesandno.setNegativeButton("NO", null);
yesandno.show();
How should I go by setting an event listener that will capture if the user clicked YES or NO?
Best Answer
When you call
setPositiveButton()
andsetNegativeButton()
instead of passing innull
you should pass in aDialogInterface.OnClickListener
.For example: