How would I set up the onClickListener for a button inside an alertDialog?
Do I just use the onClick of the whole activity or do I make a new one inside the alertDialog builder?
EDIT: Sorry I didn’t make it clear first time but this isn’t for the positive/negative buttons. This is for a button within a custom xml.
Thanks in advance
If you are wanting a standard button to dismiss the dialog then @Sergio is correct. If you are using a custom xml layout:
Use the findViewById and attach a specific listener for that button. Using an activity wide click handler would cause you problems if you were to add another button.
Android docs shows this as:
http://developer.android.com/reference/android/widget/Button.html