added in version 1.0.0
belongs to Maven artifact androidx.appcompat:appcompat:1.0.0-beta01

AppCompatDialog

public class AppCompatDialog
extends Dialog implements AppCompatCallback

java.lang.Object
   ↳ android.app.Dialog
     ↳ androidx.appcompat.app.AppCompatDialog


Base class for AppCompat themed Dialogs.

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)
boolean dispatchKeyEvent(KeyEvent event)
<T extends View> T findViewById(int id)
AppCompatDelegate getDelegate()
ActionBar getSupportActionBar()

Support library version of Dialog.getActionBar().

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

added in version 1.0.0
public AppCompatDialog (Context context)

Parameters
context Context

AppCompatDialog

added in version 1.0.0
public AppCompatDialog (Context context, 
                int theme)

Parameters
context Context

theme int

Protected constructors

AppCompatDialog

added in version 1.0.0
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

dispatchKeyEvent

public boolean dispatchKeyEvent (KeyEvent event)

Parameters
event KeyEvent

Returns
boolean

findViewById

public T findViewById (int id)

Parameters
id int

Returns
T

getDelegate

added in version 1.0.0
public AppCompatDelegate getDelegate ()

Returns
AppCompatDelegate The AppCompatDelegate being used by this Dialog.

getSupportActionBar

added in version 1.0.0
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

added in version 1.0.0
public void onSupportActionModeFinished (ActionMode mode)

Called when a support action mode has finished.

Parameters
mode ActionMode: The action mode that just finished.

onSupportActionModeStarted

added in version 1.0.0
public void onSupportActionModeStarted (ActionMode mode)

Called when a support action mode has been started.

Parameters
mode ActionMode: The new action mode.

onWindowStartingSupportActionMode

added in version 1.0.0
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 (View view)

Parameters
view View

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

added in version 1.0.0
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

onCreate

protected void onCreate (Bundle savedInstanceState)

Parameters
savedInstanceState Bundle

onStop

protected void onStop ()