AppCompatDialog
public
class
AppCompatDialog
extends Dialog
implements
AppCompatCallback
java.lang.Object | ||
↳ | android.app.Dialog | |
↳ | androidx.appcompat.app.AppCompatDialog |
Base class for AppCompat themed Dialog
s.
Summary
Inherited constants |
---|
Public constructors | |
---|---|
AppCompatDialog(Context context)
|
|
AppCompatDialog(Context context, int theme)
|
Protected constructors | |
---|---|
AppCompatDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)
|
Public methods | |
---|---|
void
|
addContentView(View view, ViewGroup.LayoutParams params)
|
void
|
dismiss()
|
boolean
|
dispatchKeyEvent(KeyEvent event)
|
<T extends View>
T
|
findViewById(int id)
|
AppCompatDelegate
|
getDelegate()
|
ActionBar
|
getSupportActionBar()
Support library version of |
void
|
onSupportActionModeFinished(ActionMode mode)
Called when a support action mode has finished. |
void
|
onSupportActionModeStarted(ActionMode mode)
Called when a support action mode has been started. |
ActionMode
|
onWindowStartingSupportActionMode(ActionMode.Callback callback)
Called when a support action mode is being started for this window. |
void
|
setContentView(View view)
|
void
|
setContentView(int layoutResID)
|
void
|
setContentView(View view, ViewGroup.LayoutParams params)
|
void
|
setTitle(CharSequence title)
|
void
|
setTitle(int titleId)
|
boolean
|
supportRequestWindowFeature(int featureId)
Enable extended support library window features. |
Protected methods | |
---|---|
void
|
onCreate(Bundle savedInstanceState)
|
void
|
onStop()
|
Inherited methods | |
---|---|
Public constructors
AppCompatDialog
public AppCompatDialog (Context context, int theme)
Parameters | |
---|---|
context |
Context |
theme |
int |
Protected constructors
AppCompatDialog
protected AppCompatDialog (Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)
Parameters | |
---|---|
context |
Context |
cancelable |
boolean |
cancelListener |
DialogInterface.OnCancelListener |
Public methods
addContentView
public void addContentView (View view, ViewGroup.LayoutParams params)
Parameters | |
---|---|
view |
View |
params |
ViewGroup.LayoutParams |
dismiss
public void dismiss ()
dispatchKeyEvent
public boolean dispatchKeyEvent (KeyEvent event)
Parameters | |
---|---|
event |
KeyEvent |
Returns | |
---|---|
boolean |
findViewById
public T findViewById (int id)
Parameters | |
---|---|
id |
int |
Returns | |
---|---|
T |
getDelegate
public AppCompatDelegate getDelegate ()
Returns | |
---|---|
AppCompatDelegate |
The AppCompatDelegate being used by this Dialog.
|
getSupportActionBar
public ActionBar getSupportActionBar ()
Support library version of Dialog.getActionBar()
.
Retrieve a reference to this dialog's ActionBar.
Returns | |
---|---|
ActionBar |
The Dialog's ActionBar, or null if it does not have one. |
onSupportActionModeFinished
public void onSupportActionModeFinished (ActionMode mode)
Called when a support action mode has finished.
Parameters | |
---|---|
mode |
ActionMode : The action mode that just finished.
|
onSupportActionModeStarted
public void onSupportActionModeStarted (ActionMode mode)
Called when a support action mode has been started.
Parameters | |
---|---|
mode |
ActionMode : The new action mode.
|
onWindowStartingSupportActionMode
public ActionMode onWindowStartingSupportActionMode (ActionMode.Callback callback)
Called when a support action mode is being started for this window. Gives the callback an opportunity to handle the action mode in its own unique and beautiful way. If this method returns null the system can choose a way to present the mode or choose not to start the mode at all.
Parameters | |
---|---|
callback |
ActionMode.Callback : Callback to control the lifecycle of this action mode |
Returns | |
---|---|
ActionMode |
The ActionMode that was started, or null if the system should present it |
setContentView
public void setContentView (int layoutResID)
Parameters | |
---|---|
layoutResID |
int |
setContentView
public void setContentView (View view, ViewGroup.LayoutParams params)
Parameters | |
---|---|
view |
View |
params |
ViewGroup.LayoutParams |
setTitle
public void setTitle (CharSequence title)
Parameters | |
---|---|
title |
CharSequence |
setTitle
public void setTitle (int titleId)
Parameters | |
---|---|
titleId |
int |
supportRequestWindowFeature
public boolean supportRequestWindowFeature (int featureId)
Enable extended support library window features.
This is a convenience for calling
getWindow().requestFeature()
.
Parameters | |
---|---|
featureId |
int : The desired feature as defined in Window or
WindowCompat . |
Returns | |
---|---|
boolean |
Returns true if the requested feature is supported and now enabled. |
Protected methods
onStop
protected void onStop ()