public class AppCompatDialog extends Dialog implements AppCompatCallback
Dialog
s.DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnShowListener
mCancelable
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
Modifier | Constructor and Description |
---|---|
|
AppCompatDialog(Context context) |
protected |
AppCompatDialog(Context context,
boolean cancelable,
DialogInterface.OnCancelListener cancelListener) |
|
AppCompatDialog(Context context,
int theme) |
Modifier and Type | Method and Description |
---|---|
void |
addContentView(View view,
ViewGroup.LayoutParams params)
Add an additional content view to the screen.
|
View |
findViewById(int id)
Finds a child view with the given identifier.
|
AppCompatDelegate |
getDelegate() |
ActionBar |
getSupportActionBar()
Support library version of
Dialog.getActionBar() . |
void |
invalidateOptionsMenu() |
protected void |
onCreate(Bundle savedInstanceState)
Similar to
Activity.onCreate(android.os.Bundle) , you should initialize your dialog
in this method, including calling Dialog.setContentView(int) . |
protected void |
onStop()
Called to tell you that you're stopping.
|
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(int layoutResID)
Set the screen content from a layout resource.
|
void |
setContentView(View view)
Set the screen content to an explicit view.
|
void |
setContentView(View view,
ViewGroup.LayoutParams params)
Set the screen content to an explicit view.
|
void |
setTitle(CharSequence title)
Set the title text for this dialog's window.
|
void |
setTitle(int titleId)
Set the title text for this dialog's window.
|
boolean |
supportRequestWindowFeature(int featureId)
Enable extended support library window features.
|
cancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setVolumeControlStream, show, takeCancelAndDismissListeners, takeKeyEvents, unregisterForContextMenu
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onProvideKeyboardShortcuts
public AppCompatDialog(Context context)
public AppCompatDialog(Context context, int theme)
protected AppCompatDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)
protected void onCreate(Bundle savedInstanceState)
Dialog
Activity.onCreate(android.os.Bundle)
, you should initialize your dialog
in this method, including calling Dialog.setContentView(int)
.onCreate
in class Dialog
savedInstanceState
- If this dialog is being reinitialized after a
the hosting activity was previously shut down, holds the result from
the most recent call to Dialog.onSaveInstanceState()
, or null if this
is the first time.public ActionBar getSupportActionBar()
Dialog.getActionBar()
.
Retrieve a reference to this dialog's ActionBar.
public void setContentView(@LayoutRes int layoutResID)
Dialog
setContentView
in class Dialog
layoutResID
- Resource ID to be inflated.public void setContentView(View view)
Dialog
setContentView
in class Dialog
view
- The desired content to display.public void setContentView(View view, ViewGroup.LayoutParams params)
Dialog
setContentView
in class Dialog
view
- The desired content to display.params
- Layout parameters for the view.@Nullable public View findViewById(@IdRes int id)
Dialog
Dialog.show()
or Dialog.create()
).findViewById
in class Dialog
id
- the identifier of the view to findpublic void setTitle(CharSequence title)
Dialog
public void setTitle(int titleId)
Dialog
public void addContentView(View view, ViewGroup.LayoutParams params)
Dialog
addContentView
in class Dialog
view
- The desired content to display.params
- Layout parameters for the view.protected void onStop()
Dialog
public boolean supportRequestWindowFeature(int featureId)
This is a convenience for calling
getWindow().requestFeature()
.
featureId
- The desired feature as defined in Window
or
WindowCompat
.Dialog.requestWindowFeature(int)
,
Window.requestFeature(int)
public void invalidateOptionsMenu()
invalidateOptionsMenu
in class Dialog
Activity.invalidateOptionsMenu()
public AppCompatDelegate getDelegate()
AppCompatDelegate
being used by this Dialog.public void onSupportActionModeStarted(ActionMode mode)
AppCompatCallback
onSupportActionModeStarted
in interface AppCompatCallback
mode
- The new action mode.public void onSupportActionModeFinished(ActionMode mode)
AppCompatCallback
onSupportActionModeFinished
in interface AppCompatCallback
mode
- The action mode that just finished.@Nullable public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback)
AppCompatCallback
onWindowStartingSupportActionMode
in interface AppCompatCallback
callback
- Callback to control the lifecycle of this action mode