Example usage for Java android.app AlertDialog fields, constructors, methods, implement or subclass
The text is from its open source code.
int | THEME_HOLO_DARK Special theme constant for #AlertDialog(Context,int) : use the holographic alert theme with a dark background. |
int | THEME_HOLO_LIGHT Special theme constant for #AlertDialog(Context,int) : use the holographic alert theme with a light background. |
int | THEME_DEVICE_DEFAULT_LIGHT Special theme constant for #AlertDialog(Context,int) : use the device's default alert theme with a light background. |
AlertDialog(Context context) Creates an alert dialog that uses the default alert dialog theme. |
void | cancel() Cancel the dialog. |
void | dismiss() Dismiss this dialog, removing it from the screen. |
T | findViewById(@IdRes int id) Finds the first descendant view with the given ID or null if the ID is invalid (< 0), there is no matching view in the hierarchy, or the dialog has not yet been fully created (for example, via #show() or #create() ). |
Button | getButton(int whichButton) Gets one of the buttons used in the dialog. |
Context | getContext() Retrieve the Context this Dialog is running in. |
LayoutInflater | getLayoutInflater() |
ListView | getListView() Gets the list view used in the dialog. |
Window | getWindow() Retrieve the current Window for the activity. |
boolean | isShowing() |
void | onWindowAttributesChanged(WindowManager.LayoutParams params) |
boolean | requestWindowFeature(int featureId) Enable extended window features. |
void | setButton(int whichButton, CharSequence text, Message msg) Set a message to be sent when a button is pressed. |
void | setButton(int whichButton, CharSequence text, OnClickListener listener) Set a listener to be invoked when the positive button of the dialog is pressed. |
void | setButton(CharSequence text, Message msg) |
void | setButton(CharSequence text, final OnClickListener listener) Set a listener to be invoked when button 1 of the dialog is pressed. |
void | setButton2(CharSequence text, Message msg) |
void | setButton2(CharSequence text, final OnClickListener listener) Set a listener to be invoked when button 2 of the dialog is pressed. |
void | setButton3(CharSequence text, Message msg) |
void | setButton3(CharSequence text, final OnClickListener listener) Set a listener to be invoked when button 3 of the dialog is pressed. |
void | setCancelable(boolean flag) Sets whether this dialog is cancelable with the KeyEvent#KEYCODE_BACK BACK key. |
void | setCanceledOnTouchOutside(boolean cancel) Sets whether this dialog is canceled when touched outside the window's bounds. |
void | setContentView(@LayoutRes int layoutResID) Set the screen content from a layout resource. |
void | setIcon(@DrawableRes int resId) Set resId to 0 if you don't want an icon. |
void | setIcon(Drawable icon) |
void | setInverseBackgroundForced(boolean forceInverseBackground) |
void | setMessage(CharSequence message) |
void | setOnCancelListener(@Nullable OnCancelListener listener) Set a listener to be invoked when the dialog is canceled. |
void | setOnDismissListener(@Nullable OnDismissListener listener) Set a listener to be invoked when the dialog is dismissed. |
void | setOnKeyListener(@Nullable OnKeyListener onKeyListener) Sets the callback that will be called if a key is dispatched to the dialog. |
void | setOnShowListener(@Nullable OnShowListener listener) Sets a listener to be invoked when the dialog is shown. |
void | setOwnerActivity(@NonNull Activity activity) Sets the Activity that owns this dialog. |
void | setTitle(CharSequence title) |
void | setView(View view) Set the view to display in that dialog. |
void | setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom) Set the view to display in that dialog, specifying the spacing to appear around that view. |
void | setVolumeControlStream(int streamType) By default, this will use the owner Activity's suggested stream type. |
void | show() Start the dialog and display it on screen. |