Added in API level 1

DialogInterface.OnClickListener


public static interface DialogInterface.OnClickListener

android.content.DialogInterface.OnClickListener
DatePickerDialog A simple dialog containing an DatePicker
DialogPreference This class was deprecated in API level 29. Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings. 
EditTextPreference This class was deprecated in API level 29. Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings. 
ListPreference This class was deprecated in API level 29. Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings. 
MultiSelectListPreference This class was deprecated in API level 29. Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings. 
Spinner A view that displays one child at a time and lets the user pick among them. 
TimePickerDialog A dialog that prompts the user for the time of day using a TimePicker


Interface used to allow the creator of a dialog to run some code when an item on the dialog is clicked.

Summary

Public methods

abstract void onClick(DialogInterface dialog, int which)

This method will be invoked when a button in the dialog is clicked.

Public methods

onClick

Added in API level 1
public abstract void onClick (DialogInterface dialog, 
                int which)

This method will be invoked when a button in the dialog is clicked.

Parameters
dialog DialogInterface: the dialog that received the click

which int: the button that was clicked (ex. DialogInterface.BUTTON_POSITIVE) or the position of the item clicked