Stay organized with collections Save and categorize content based on your preferences.

ComponentDialog

public class ComponentDialog extends Dialog implements LifecycleOwner, OnBackPressedDispatcherOwner, SavedStateRegistryOwner

Known direct subclasses
AppCompatDialog

Base class for AppCompat themed android.app.Dialogs.

Known indirect subclasses
AlertDialog

A subclass of Dialog that can display one, two or three buttons.

MediaRouteChooserDialog

This class implements the route chooser dialog for MediaRouter.

MediaRouteControllerDialog

This class implements the route controller dialog for MediaRouter.


Base class for dialogs that enables composition of higher level components.

Summary

Public constructors

ComponentDialog(@NonNull Context context, @StyleRes int themeResId)

Public methods

void
@NonNull Lifecycle

Returns the Lifecycle of the provider.

final @NonNull OnBackPressedDispatcher

The OnBackPressedDispatcher that should handle the system back button.

@NonNull SavedStateRegistry

The SavedStateRegistry owned by this SavedStateRegistryOwner

void
@NonNull Bundle
void
setContentView(int layoutResID)
void
void

Protected methods

void
@CallSuper
onCreate(Bundle savedInstanceState)
void
void

Inherited methods

From android.app.Dialog
void
void
void
void
boolean
boolean
boolean
boolean
boolean
boolean
@NonNull T
<T extends View> findViewById(int p0)
@Nullable ActionBar
final @NonNull @NonNull Context
@Nullable View
@NonNull @NonNull LayoutInflater
@NonNull @NonNull OnBackInvokedDispatcher
final @Nullable Activity
final @Nullable SearchEvent
final int
@Nullable Window
void
void
boolean
void
void
void
void
boolean
void
void
boolean
boolean
View
void
boolean
boolean
boolean
boolean
onKeyMultiple(int p0, int p1, @NonNull @NonNull KeyEvent p2)
boolean
boolean
onKeyUp(int p0, @NonNull @NonNull KeyEvent p1)
boolean
boolean
onMenuOpened(int p0, @NonNull @NonNull Menu p1)
boolean
void
void
boolean
boolean
void
boolean
boolean
boolean
boolean
void
void
ActionMode
ActionMode
void
void
void
final boolean
final @NonNull @NonNull T
<T extends View> requireViewById(int p0)
void
void
setCancelable(boolean p0)
void
void
final void
final void
setFeatureDrawableAlpha(int p0, int p1)
final void
setFeatureDrawableResource(int p0, int p1)
final void
void
void
void
void
final void
void
setTitle(int p0)
void
final void
void
void
takeKeyEvents(boolean p0)
void
From android.view.Window.Callback
void
void

Public constructors

ComponentDialog

public ComponentDialog(@NonNull Context context, @StyleRes int themeResId)

Public methods

addContentView

public void addContentView(@NonNull View view, ViewGroup.LayoutParams params)

getLifecycle

public @NonNull Lifecycle getLifecycle()

Returns the Lifecycle of the provider.

Returns
@NonNull Lifecycle

The lifecycle of the provider.

getOnBackPressedDispatcher

public final @NonNull OnBackPressedDispatcher getOnBackPressedDispatcher()

The OnBackPressedDispatcher that should handle the system back button.

getSavedStateRegistry

public @NonNull SavedStateRegistry getSavedStateRegistry()

The SavedStateRegistry owned by this SavedStateRegistryOwner

onBackPressed

@CallSuper
public void onBackPressed()

onSaveInstanceState

public @NonNull Bundle onSaveInstanceState()

setContentView

public void setContentView(int layoutResID)

setContentView

public void setContentView(@NonNull View view)

setContentView

public void setContentView(@NonNull View view, ViewGroup.LayoutParams params)

Protected methods

onCreate

@CallSuper
protected void onCreate(Bundle savedInstanceState)

onStart

@CallSuper
protected void onStart()

onStop

@CallSuper
protected void onStop()