Example usage for Java android.app Dialog fields, constructors, methods, implement or subclass
The text is from its open source code.
Dialog(@NonNull Context context) Creates a dialog window that uses the default dialog theme. | |
Dialog(@NonNull Context context, @StyleRes int themeResId) Creates a dialog window that uses a custom dialog style. |
void | addContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params) Add an additional content view to the screen. |
void | dispatchOnCreate(Bundle savedInstanceState) |
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() ). |
Class> | getClass() Returns the runtime class of this Object . |
Context | getContext() Retrieve the Context this Dialog is running in. |
View | getCurrentFocus() Call android.view.Window#getCurrentFocus on the Window if this Activity to return the currently focused view. |
LayoutInflater | getLayoutInflater() |
Window | getWindow() Retrieve the current Window for the activity. |
int | hashCode() Returns a hash code value for the object. |
void | hide() Hide the dialog, but do not dismiss it. |
boolean | isShowing() |
void | onRestoreInstanceState(@NonNull Bundle savedInstanceState) Restore the state of the dialog from a previously saved bundle. |
boolean | requestWindowFeature(int featureId) Enable extended window features. |
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 | setContentView(@NonNull View view) Set the screen content to an explicit view. |
void | setContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params) Set the screen content to an explicit view. |
void | setDismissMessage(@Nullable Message msg) Set a message to be sent when the dialog is dismissed. |
void | setFeatureDrawableResource(int featureId, @DrawableRes int resId) Convenience for calling android.view.Window#setFeatureDrawableResource . |
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(@Nullable CharSequence title) Set the title text for this dialog's window. |
void | setTitle(@StringRes int titleId) Set the title text for this dialog's window. |
void | setVolumeControlStream(int streamType) By default, this will use the owner Activity's suggested stream type. |