DialogInterface
public
interface
DialogInterface
android.content.DialogInterface |
Interface that defines a dialog-type class that can be shown, dismissed, or canceled, and may have buttons that can be clicked.
Summary
Nested classes | |
---|---|
interface |
DialogInterface.OnCancelListener
Interface used to allow the creator of a dialog to run some code when the dialog is canceled. |
interface |
DialogInterface.OnClickListener
Interface used to allow the creator of a dialog to run some code when an item on the dialog is clicked. |
interface |
DialogInterface.OnDismissListener
Interface used to allow the creator of a dialog to run some code when the dialog is dismissed. |
interface |
DialogInterface.OnKeyListener
Interface definition for a callback to be invoked when a key event is dispatched to this dialog. |
interface |
DialogInterface.OnMultiChoiceClickListener
Interface used to allow the creator of a dialog to run some code when an item in a multi-choice dialog is clicked. |
interface |
DialogInterface.OnShowListener
Interface used to allow the creator of a dialog to run some code when the dialog is shown. |
Constants | |
---|---|
int |
BUTTON1
This constant was deprecated
in API level 15.
Use |
int |
BUTTON2
This constant was deprecated
in API level 15.
Use |
int |
BUTTON3
This constant was deprecated
in API level 15.
Use |
int |
BUTTON_NEGATIVE
The identifier for the negative button. |
int |
BUTTON_NEUTRAL
The identifier for the neutral button. |
int |
BUTTON_POSITIVE
The identifier for the positive button. |
Public methods | |
---|---|
abstract
void
|
cancel()
Cancels the dialog, invoking the |
abstract
void
|
dismiss()
Dismisses the dialog, invoking the |
Constants
BUTTON1
public static final int BUTTON1
This constant was deprecated
in API level 15.
Use BUTTON_POSITIVE
Constant Value: -1 (0xffffffff)
BUTTON2
public static final int BUTTON2
This constant was deprecated
in API level 15.
Use BUTTON_NEGATIVE
Constant Value: -2 (0xfffffffe)
BUTTON3
public static final int BUTTON3
This constant was deprecated
in API level 15.
Use BUTTON_NEUTRAL
Constant Value: -3 (0xfffffffd)
BUTTON_NEGATIVE
public static final int BUTTON_NEGATIVE
The identifier for the negative button.
Constant Value: -2 (0xfffffffe)
BUTTON_NEUTRAL
public static final int BUTTON_NEUTRAL
The identifier for the neutral button.
Constant Value: -3 (0xfffffffd)
BUTTON_POSITIVE
public static final int BUTTON_POSITIVE
The identifier for the positive button.
Constant Value: -1 (0xffffffff)
Public methods
cancel
public abstract void cancel ()
Cancels the dialog, invoking the OnCancelListener
.
The OnDismissListener
may also be called if cancellation
dismisses the dialog.
dismiss
public abstract void dismiss ()
Dismisses the dialog, invoking the OnDismissListener
.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-04 UTC.