Java android.app Dialog fields, constructors, methods, implement or subclass

Example usage for Java android.app Dialog fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.app Dialog.

The text is from its open source code.

Subclass

android.app.Dialog has subclasses.
Click this link to see all its subclasses.

Constructor

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.

Method

voidaddContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params)
Add an additional content view to the screen.
voiddispatchOnCreate(Bundle savedInstanceState)
TfindViewById(@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() ).
ClassgetClass()
Returns the runtime class of this Object .
ContextgetContext()
Retrieve the Context this Dialog is running in.
ViewgetCurrentFocus()
Call android.view.Window#getCurrentFocus on the Window if this Activity to return the currently focused view.
LayoutInflatergetLayoutInflater()
WindowgetWindow()
Retrieve the current Window for the activity.
inthashCode()
Returns a hash code value for the object.
voidhide()
Hide the dialog, but do not dismiss it.
booleanisShowing()
voidonRestoreInstanceState(@NonNull Bundle savedInstanceState)
Restore the state of the dialog from a previously saved bundle.
booleanrequestWindowFeature(int featureId)
Enable extended window features.
voidsetCancelable(boolean flag)
Sets whether this dialog is cancelable with the KeyEvent#KEYCODE_BACK BACK key.
voidsetCanceledOnTouchOutside(boolean cancel)
Sets whether this dialog is canceled when touched outside the window's bounds.
voidsetContentView(@LayoutRes int layoutResID)
Set the screen content from a layout resource.
voidsetContentView(@NonNull View view)
Set the screen content to an explicit view.
voidsetContentView(@NonNull View view, @Nullable ViewGroup.LayoutParams params)
Set the screen content to an explicit view.
voidsetDismissMessage(@Nullable Message msg)
Set a message to be sent when the dialog is dismissed.
voidsetFeatureDrawableResource(int featureId, @DrawableRes int resId)
Convenience for calling android.view.Window#setFeatureDrawableResource .
voidsetOnCancelListener(@Nullable OnCancelListener listener)
Set a listener to be invoked when the dialog is canceled.
voidsetOnDismissListener(@Nullable OnDismissListener listener)
Set a listener to be invoked when the dialog is dismissed.
voidsetOnKeyListener(@Nullable OnKeyListener onKeyListener)
Sets the callback that will be called if a key is dispatched to the dialog.
voidsetOnShowListener(@Nullable OnShowListener listener)
Sets a listener to be invoked when the dialog is shown.
voidsetOwnerActivity(@NonNull Activity activity)
Sets the Activity that owns this dialog.
voidsetTitle(@Nullable CharSequence title)
Set the title text for this dialog's window.
voidsetTitle(@StringRes int titleId)
Set the title text for this dialog's window.
voidsetVolumeControlStream(int streamType)
By default, this will use the owner Activity's suggested stream type.