Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

AppCompatDialog

open class AppCompatDialog : Dialog, AppCompatCallback
kotlin.Any
   ↳ android.app.Dialog
   ↳ androidx.appcompat.app.AppCompatDialog

Base class for AppCompat themed android.app.Dialogs.

Summary

Public constructors

<init>(context: Context!)

<init>(context: Context!, theme: Int)

Protected constructors

<init>(context: Context!, cancelable: Boolean, cancelListener: OnCancelListener!)

Public methods

open Unit
addContentView(view: View!, params: LayoutParams!)

open Boolean

open T?
findViewById(@IdRes id: Int)

open AppCompatDelegate!

open ActionBar!

Support library version of android.app.Dialog#getActionBar.

open Unit

open Unit

open ActionMode?

open Unit
setContentView(@LayoutRes layoutResID: Int)

open Unit

open Unit
setContentView(view: View!, params: LayoutParams!)

open Unit

open Unit
setTitle(titleId: Int)

open Boolean

Enable extended support library window features.

Protected methods

open Unit
onCreate(savedInstanceState: Bundle!)

open Unit

Public constructors

<init>

AppCompatDialog(context: Context!)

<init>

AppCompatDialog(context: Context!, theme: Int)

Protected constructors

<init>

protected AppCompatDialog(context: Context!, cancelable: Boolean, cancelListener: OnCancelListener!)

Public methods

addContentView

open fun addContentView(view: View!, params: LayoutParams!): Unit

dispatchKeyEvent

open fun dispatchKeyEvent(event: KeyEvent!): Boolean

findViewById

@Nullable open fun <T : View!> findViewById(@IdRes id: Int): T?

getDelegate

open fun getDelegate(): AppCompatDelegate!
Return
AppCompatDelegate!: The AppCompatDelegate being used by this Dialog.

getSupportActionBar

open fun getSupportActionBar(): ActionBar!

Support library version of android.app.Dialog#getActionBar.

Retrieve a reference to this dialog's ActionBar.

Return
ActionBar!: The Dialog's ActionBar, or null if it does not have one.

onSupportActionModeFinished

open fun onSupportActionModeFinished(mode: ActionMode!): Unit

onSupportActionModeStarted

open fun onSupportActionModeStarted(mode: ActionMode!): Unit

onWindowStartingSupportActionMode

@Nullable open fun onWindowStartingSupportActionMode(callback: ActionMode.Callback!): ActionMode?

setContentView

open fun setContentView(@LayoutRes layoutResID: Int): Unit

setContentView

open fun setContentView(view: View!): Unit

setContentView

open fun setContentView(view: View!, params: LayoutParams!): Unit

setTitle

open fun setTitle(title: CharSequence!): Unit

setTitle

open fun setTitle(titleId: Int): Unit

supportRequestWindowFeature

open fun supportRequestWindowFeature(featureId: Int): Boolean

Enable extended support library window features.

This is a convenience for calling getWindow().requestFeature().

Parameters
featureId Int: The desired feature as defined in android.view.Window or androidx.core.view.WindowCompat.
Return
Boolean: Returns true if the requested feature is supported and now enabled.

Protected methods

onCreate

protected open fun onCreate(savedInstanceState: Bundle!): Unit

onStop

protected open fun onStop(): Unit