# PreferenceDialogFragment

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1  
Summary:[Constants](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#constants)\|[Inherited Constants](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#inhconstants)\|[Ctors](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)  

# PreferenceDialogFragment

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


abstract
class
PreferenceDialogFragment
`  
`


``


``

extends `[DialogFragment](https://developer.android.com/reference/android/app/DialogFragment.html)`


``


implements

`[DialogInterface.OnClickListener](https://developer.android.com/reference/android/content/DialogInterface.OnClickListener.html)`


`

|---|---|---|---------------------------------------------------------|
| java.lang.Object                                                 ||||
| ↳ | [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) |||
|   | ↳ | [android.app.DialogFragment](https://developer.android.com/reference/android/app/DialogFragment.html) ||
|   |   | ↳ | android.support.v14.preference.PreferenceDialogFragment |

|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)Known Direct Subclasses [EditTextPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/EditTextPreferenceDialogFragment),[ListPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/ListPreferenceDialogFragment),[MultiSelectListPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/MultiSelectListPreferenceDialogFragment) |-----------------------------------------------------------------------------------------------------------------------------------------------------------|---| | [EditTextPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/EditTextPreferenceDialogFragment)               |   | | [ListPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/ListPreferenceDialogFragment)                       |   | | [MultiSelectListPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/MultiSelectListPreferenceDialogFragment) |   | |

<br />

*** ** * ** ***

Abstract base class which presents a dialog associated with a[DialogPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference). Since the preference object may not be available during fragment re-creation, the necessary information for displaying the dialog is read once during the initial call to[onCreate(Bundle)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onCreate(android.os.Bundle))and saved/restored in the saved instance state. Custom subclasses should also follow this pattern.

## Summary

|                                                            ### Constants                                                            ||
|----------|---------------------------------------------------------------------------------------------------------------------------|
| `String` | [ARG_KEY](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#ARG_KEY) <br /> |

|                                                                                                                                                                                                                                                                                                                   ### Inherited constants                                                                                                                                                                                                                                                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From class` android.app.DialogFragment ` |-------|-------------------------| | `int` | `STYLE_NORMAL` <br />   | | `int` | `STYLE_NO_FRAME` <br /> | | `int` | `STYLE_NO_INPUT` <br /> | | `int` | `STYLE_NO_TITLE` <br /> |                                                                                                                                                                                                                                          |
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` android.content.ComponentCallbacks2 ` |-------|---------------------------------------| | `int` | `TRIM_MEMORY_BACKGROUND` <br />       | | `int` | `TRIM_MEMORY_COMPLETE` <br />         | | `int` | `TRIM_MEMORY_MODERATE` <br />         | | `int` | `TRIM_MEMORY_RUNNING_CRITICAL` <br /> | | `int` | `TRIM_MEMORY_RUNNING_LOW` <br />      | | `int` | `TRIM_MEMORY_RUNNING_MODERATE` <br /> | | `int` | `TRIM_MEMORY_UI_HIDDEN` <br />        | |

|                                                                      ### Public constructors                                                                      ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[PreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#PreferenceDialogFragment())`() ` |

|                                                                                                                                                                                         ### Public methods                                                                                                                                                                                         ||
|---------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[DialogPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference) | ` `[getPreference](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#getPreference())`() ` Get the preference that requested this dialog.                                                                                             |
| ` void`                                                                                                       | ` `[onClick](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onClick(android.content.DialogInterface, int))`(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` dialog, int which) ` |
| ` void`                                                                                                       | ` `[onCreate](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onCreate(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) `                                        |
| ` `[Dialog](https://developer.android.com/reference/android/app/Dialog.html)                                  | ` `[onCreateDialog](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onCreateDialog(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` savedInstanceState) `                            |
| ` abstract void`                                                                                              | ` `[onDialogClosed](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onDialogClosed(boolean))`(boolean positiveResult) `                                                                                                             |
| ` void`                                                                                                       | ` `[onDismiss](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onDismiss(android.content.DialogInterface))`(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` dialog) `             |
| ` void`                                                                                                       | ` `[onSaveInstanceState](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onSaveInstanceState(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` outState) `                            |

|                                                                                                                                                                                                                   ### Protected methods                                                                                                                                                                                                                   ||
|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                   | ` `[onBindDialogView](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onBindDialogView(android.view.View))`(`[View](https://developer.android.com/reference/android/view/View.html)` view) ` Binds views in the content View of the dialog to data.                                                                            |
| ` `[View](https://developer.android.com/reference/android/view/View.html) | ` `[onCreateDialogView](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onCreateDialogView(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context) ` Creates the content view for the dialog (if a custom content view is required).                             |
| ` void`                                                                   | ` `[onPrepareDialogBuilder](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onPrepareDialogBuilder(android.app.AlertDialog.Builder))`(`[AlertDialog.Builder](https://developer.android.com/reference/android/app/AlertDialog.Builder.html)` builder) ` Prepares the dialog builder to be shown when the preference is clicked. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From class` `[android.app.DialogFragment](https://developer.android.com/reference/android/app/DialogFragment.html)` ` |------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                      | ` dismiss() `                                                                                                                     | | ` void`                                                                      | ` dismissAllowingStateLoss() `                                                                                                    | | ` void`                                                                      | ` dump(String arg0, FileDescriptor arg1, PrintWriter arg2, String[] arg3) `                                                       | | ` `[Dialog](https://developer.android.com/reference/android/app/Dialog.html) | ` getDialog() `                                                                                                                   | | ` boolean`                                                                   | ` getShowsDialog() `                                                                                                              | | ` int`                                                                       | ` getTheme() `                                                                                                                    | | ` boolean`                                                                   | ` isCancelable() `                                                                                                                | | ` void`                                                                      | ` onActivityCreated(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                            | | ` void`                                                                      | ` onAttach(`[Context](https://developer.android.com/reference/android/content/Context.html)` arg0) `                              | | ` void`                                                                      | ` onCancel(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` arg0) `              | | ` void`                                                                      | ` onCreate(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                     | | ` `[Dialog](https://developer.android.com/reference/android/app/Dialog.html) | ` onCreateDialog(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                               | | ` void`                                                                      | ` onDestroyView() `                                                                                                               | | ` void`                                                                      | ` onDetach() `                                                                                                                    | | ` void`                                                                      | ` onDismiss(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` arg0) `             | | ` void`                                                                      | ` onSaveInstanceState(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                          | | ` void`                                                                      | ` onStart() `                                                                                                                     | | ` void`                                                                      | ` onStop() `                                                                                                                      | | ` void`                                                                      | ` setCancelable(boolean arg0) `                                                                                                   | | ` void`                                                                      | ` setShowsDialog(boolean arg0) `                                                                                                  | | ` void`                                                                      | ` setStyle(int arg0, int arg1) `                                                                                                  | | ` void`                                                                      | ` show(`[FragmentManager](https://developer.android.com/reference/android/app/FragmentManager.html)` arg0, String arg1) `         | | ` int`                                                                       | ` show(`[FragmentTransaction](https://developer.android.com/reference/android/app/FragmentTransaction.html)` arg0, String arg1) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From class` `[android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html)` ` |------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                              | ` dump(String arg0, FileDescriptor arg1, PrintWriter arg2, String[] arg3) `                                                                                                                                                                                                                                                                     | | ` final boolean`                                                                                     | ` equals(Object arg0) `                                                                                                                                                                                                                                                                                                                         | | ` final `[Activity](https://developer.android.com/reference/android/app/Activity.html)               | ` getActivity() `                                                                                                                                                                                                                                                                                                                               | | ` boolean`                                                                                           | ` getAllowEnterTransitionOverlap() `                                                                                                                                                                                                                                                                                                            | | ` boolean`                                                                                           | ` getAllowReturnTransitionOverlap() `                                                                                                                                                                                                                                                                                                           | | ` final `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)                    | ` getArguments() `                                                                                                                                                                                                                                                                                                                              | | ` final `[FragmentManager](https://developer.android.com/reference/android/app/FragmentManager.html) | ` getChildFragmentManager() `                                                                                                                                                                                                                                                                                                                   | | ` `[Context](https://developer.android.com/reference/android/content/Context.html)                   | ` getContext() `                                                                                                                                                                                                                                                                                                                                | | ` `[Transition](https://developer.android.com/reference/android/transition/Transition.html)          | ` getEnterTransition() `                                                                                                                                                                                                                                                                                                                        | | ` `[Transition](https://developer.android.com/reference/android/transition/Transition.html)          | ` getExitTransition() `                                                                                                                                                                                                                                                                                                                         | | ` final `[FragmentManager](https://developer.android.com/reference/android/app/FragmentManager.html) | ` getFragmentManager() `                                                                                                                                                                                                                                                                                                                        | | ` final Object`                                                                                      | ` getHost() `                                                                                                                                                                                                                                                                                                                                   | | ` final int`                                                                                         | ` getId() `                                                                                                                                                                                                                                                                                                                                     | | ` final `[LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html)  | ` getLayoutInflater() `                                                                                                                                                                                                                                                                                                                         | | ` `[LoaderManager](https://developer.android.com/reference/android/app/LoaderManager.html)           | ` getLoaderManager() `                                                                                                                                                                                                                                                                                                                          | | ` final `[Fragment](https://developer.android.com/reference/android/app/Fragment.html)               | ` getParentFragment() `                                                                                                                                                                                                                                                                                                                         | | ` `[Transition](https://developer.android.com/reference/android/transition/Transition.html)          | ` getReenterTransition() `                                                                                                                                                                                                                                                                                                                      | | ` final `[Resources](https://developer.android.com/reference/android/content/res/Resources.html)     | ` getResources() `                                                                                                                                                                                                                                                                                                                              | | ` final boolean`                                                                                     | ` getRetainInstance() `                                                                                                                                                                                                                                                                                                                         | | ` `[Transition](https://developer.android.com/reference/android/transition/Transition.html)          | ` getReturnTransition() `                                                                                                                                                                                                                                                                                                                       | | ` `[Transition](https://developer.android.com/reference/android/transition/Transition.html)          | ` getSharedElementEnterTransition() `                                                                                                                                                                                                                                                                                                           | | ` `[Transition](https://developer.android.com/reference/android/transition/Transition.html)          | ` getSharedElementReturnTransition() `                                                                                                                                                                                                                                                                                                          | | ` final String`                                                                                      | ` getString(int arg0, Object... arg1) `                                                                                                                                                                                                                                                                                                         | | ` final String`                                                                                      | ` getString(int arg0) `                                                                                                                                                                                                                                                                                                                         | | ` final String`                                                                                      | ` getTag() `                                                                                                                                                                                                                                                                                                                                    | | ` final `[Fragment](https://developer.android.com/reference/android/app/Fragment.html)               | ` getTargetFragment() `                                                                                                                                                                                                                                                                                                                         | | ` final int`                                                                                         | ` getTargetRequestCode() `                                                                                                                                                                                                                                                                                                                      | | ` final CharSequence`                                                                                | ` getText(int arg0) `                                                                                                                                                                                                                                                                                                                           | | ` boolean`                                                                                           | ` getUserVisibleHint() `                                                                                                                                                                                                                                                                                                                        | | ` `[View](https://developer.android.com/reference/android/view/View.html)                            | ` getView() `                                                                                                                                                                                                                                                                                                                                   | | ` final int`                                                                                         | ` hashCode() `                                                                                                                                                                                                                                                                                                                                  | | ` static `[Fragment](https://developer.android.com/reference/android/app/Fragment.html)              | ` instantiate(`[Context](https://developer.android.com/reference/android/content/Context.html)` arg0, String arg1) `                                                                                                                                                                                                                            | | ` static `[Fragment](https://developer.android.com/reference/android/app/Fragment.html)              | ` instantiate(`[Context](https://developer.android.com/reference/android/content/Context.html)` arg0, String arg1, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg2) `                                                                                                                                           | | ` final boolean`                                                                                     | ` isAdded() `                                                                                                                                                                                                                                                                                                                                   | | ` final boolean`                                                                                     | ` isDetached() `                                                                                                                                                                                                                                                                                                                                | | ` final boolean`                                                                                     | ` isHidden() `                                                                                                                                                                                                                                                                                                                                  | | ` final boolean`                                                                                     | ` isInLayout() `                                                                                                                                                                                                                                                                                                                                | | ` final boolean`                                                                                     | ` isRemoving() `                                                                                                                                                                                                                                                                                                                                | | ` final boolean`                                                                                     | ` isResumed() `                                                                                                                                                                                                                                                                                                                                 | | ` final boolean`                                                                                     | ` isStateSaved() `                                                                                                                                                                                                                                                                                                                              | | ` final boolean`                                                                                     | ` isVisible() `                                                                                                                                                                                                                                                                                                                                 | | ` void`                                                                                              | ` onActivityCreated(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                                                                                                                                                                                                                          | | ` void`                                                                                              | ` onActivityResult(int arg0, int arg1, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` arg2) `                                                                                                                                                                                                                  | | ` void`                                                                                              | ` onAttach(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` arg0) `                                                                                                                                                                                                                                              | | ` void`                                                                                              | ` onAttach(`[Context](https://developer.android.com/reference/android/content/Context.html)` arg0) `                                                                                                                                                                                                                                            | | ` void`                                                                                              | ` onAttachFragment(`[Fragment](https://developer.android.com/reference/android/app/Fragment.html)` arg0) `                                                                                                                                                                                                                                      | | ` void`                                                                                              | ` onConfigurationChanged(`[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)` arg0) `                                                                                                                                                                                                              | | ` boolean`                                                                                           | ` onContextItemSelected(`[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)` arg0) `                                                                                                                                                                                                                                | | ` void`                                                                                              | ` onCreate(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                                                                                                                                                                                                                                   | | ` `[Animator](https://developer.android.com/reference/android/animation/Animator.html)               | ` onCreateAnimator(int arg0, boolean arg1, int arg2) `                                                                                                                                                                                                                                                                                          | | ` void`                                                                                              | ` onCreateContextMenu(`[ContextMenu](https://developer.android.com/reference/android/view/ContextMenu.html)` arg0, `[View](https://developer.android.com/reference/android/view/View.html)` arg1, `[ContextMenu.ContextMenuInfo](https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html)` arg2) `                | | ` void`                                                                                              | ` onCreateOptionsMenu(`[Menu](https://developer.android.com/reference/android/view/Menu.html)` arg0, `[MenuInflater](https://developer.android.com/reference/android/view/MenuInflater.html)` arg1) `                                                                                                                                           | | ` `[View](https://developer.android.com/reference/android/view/View.html)                            | ` onCreateView(`[LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html)` arg0, `[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)` arg1, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg2) `                                                   | | ` void`                                                                                              | ` onDestroy() `                                                                                                                                                                                                                                                                                                                                 | | ` void`                                                                                              | ` onDestroyOptionsMenu() `                                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                              | ` onDestroyView() `                                                                                                                                                                                                                                                                                                                             | | ` void`                                                                                              | ` onDetach() `                                                                                                                                                                                                                                                                                                                                  | | ` `[LayoutInflater](https://developer.android.com/reference/android/view/LayoutInflater.html)        | ` onGetLayoutInflater(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                                                                                                                                                                                                                        | | ` void`                                                                                              | ` onHiddenChanged(boolean arg0) `                                                                                                                                                                                                                                                                                                               | | ` void`                                                                                              | ` onInflate(`[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)` arg0, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg1) `                                                                                                                                                   | | ` void`                                                                                              | ` onInflate(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` arg0, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)` arg1, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg2) `                                                             | | ` void`                                                                                              | ` onInflate(`[Context](https://developer.android.com/reference/android/content/Context.html)` arg0, `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)` arg1, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg2) `                                                           | | ` void`                                                                                              | ` onLowMemory() `                                                                                                                                                                                                                                                                                                                               | | ` void`                                                                                              | ` onMultiWindowModeChanged(boolean arg0) `                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                              | ` onMultiWindowModeChanged(boolean arg0, `[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)` arg1) `                                                                                                                                                                                              | | ` boolean`                                                                                           | ` onOptionsItemSelected(`[MenuItem](https://developer.android.com/reference/android/view/MenuItem.html)` arg0) `                                                                                                                                                                                                                                | | ` void`                                                                                              | ` onOptionsMenuClosed(`[Menu](https://developer.android.com/reference/android/view/Menu.html)` arg0) `                                                                                                                                                                                                                                          | | ` void`                                                                                              | ` onPause() `                                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                                              | ` onPictureInPictureModeChanged(boolean arg0, `[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)` arg1) `                                                                                                                                                                                         | | ` void`                                                                                              | ` onPictureInPictureModeChanged(boolean arg0) `                                                                                                                                                                                                                                                                                                 | | ` void`                                                                                              | ` onPrepareOptionsMenu(`[Menu](https://developer.android.com/reference/android/view/Menu.html)` arg0) `                                                                                                                                                                                                                                         | | ` void`                                                                                              | ` onRequestPermissionsResult(int arg0, String[] arg1, int[] arg2) `                                                                                                                                                                                                                                                                             | | ` void`                                                                                              | ` onResume() `                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                                              | ` onSaveInstanceState(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                                                                                                                                                                                                                        | | ` void`                                                                                              | ` onStart() `                                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                                              | ` onStop() `                                                                                                                                                                                                                                                                                                                                    | | ` void`                                                                                              | ` onTrimMemory(int arg0) `                                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                              | ` onViewCreated(`[View](https://developer.android.com/reference/android/view/View.html)` arg0, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg1) `                                                                                                                                                               | | ` void`                                                                                              | ` onViewStateRestored(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                                                                                                                                                                                                                        | | ` void`                                                                                              | ` postponeEnterTransition() `                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                                              | ` registerForContextMenu(`[View](https://developer.android.com/reference/android/view/View.html)` arg0) `                                                                                                                                                                                                                                       | | ` final void`                                                                                        | ` requestPermissions(String[] arg0, int arg1) `                                                                                                                                                                                                                                                                                                 | | ` void`                                                                                              | ` setAllowEnterTransitionOverlap(boolean arg0) `                                                                                                                                                                                                                                                                                                | | ` void`                                                                                              | ` setAllowReturnTransitionOverlap(boolean arg0) `                                                                                                                                                                                                                                                                                               | | ` void`                                                                                              | ` setArguments(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg0) `                                                                                                                                                                                                                                               | | ` void`                                                                                              | ` setEnterSharedElementCallback(`[SharedElementCallback](https://developer.android.com/reference/android/app/SharedElementCallback.html)` arg0) `                                                                                                                                                                                               | | ` void`                                                                                              | ` setEnterTransition(`[Transition](https://developer.android.com/reference/android/transition/Transition.html)` arg0) `                                                                                                                                                                                                                         | | ` void`                                                                                              | ` setExitSharedElementCallback(`[SharedElementCallback](https://developer.android.com/reference/android/app/SharedElementCallback.html)` arg0) `                                                                                                                                                                                                | | ` void`                                                                                              | ` setExitTransition(`[Transition](https://developer.android.com/reference/android/transition/Transition.html)` arg0) `                                                                                                                                                                                                                          | | ` void`                                                                                              | ` setHasOptionsMenu(boolean arg0) `                                                                                                                                                                                                                                                                                                             | | ` void`                                                                                              | ` setInitialSavedState(`[Fragment.SavedState](https://developer.android.com/reference/android/app/Fragment.SavedState.html)` arg0) `                                                                                                                                                                                                            | | ` void`                                                                                              | ` setMenuVisibility(boolean arg0) `                                                                                                                                                                                                                                                                                                             | | ` void`                                                                                              | ` setReenterTransition(`[Transition](https://developer.android.com/reference/android/transition/Transition.html)` arg0) `                                                                                                                                                                                                                       | | ` void`                                                                                              | ` setRetainInstance(boolean arg0) `                                                                                                                                                                                                                                                                                                             | | ` void`                                                                                              | ` setReturnTransition(`[Transition](https://developer.android.com/reference/android/transition/Transition.html)` arg0) `                                                                                                                                                                                                                        | | ` void`                                                                                              | ` setSharedElementEnterTransition(`[Transition](https://developer.android.com/reference/android/transition/Transition.html)` arg0) `                                                                                                                                                                                                            | | ` void`                                                                                              | ` setSharedElementReturnTransition(`[Transition](https://developer.android.com/reference/android/transition/Transition.html)` arg0) `                                                                                                                                                                                                           | | ` void`                                                                                              | ` setTargetFragment(`[Fragment](https://developer.android.com/reference/android/app/Fragment.html)` arg0, int arg1) `                                                                                                                                                                                                                           | | ` void`                                                                                              | ` setUserVisibleHint(boolean arg0) `                                                                                                                                                                                                                                                                                                            | | ` boolean`                                                                                           | ` shouldShowRequestPermissionRationale(String arg0) `                                                                                                                                                                                                                                                                                           | | ` void`                                                                                              | ` startActivity(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` arg0) `                                                                                                                                                                                                                                         | | ` void`                                                                                              | ` startActivity(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` arg0, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg1) `                                                                                                                                                        | | ` void`                                                                                              | ` startActivityForResult(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` arg0, int arg1) `                                                                                                                                                                                                                      | | ` void`                                                                                              | ` startActivityForResult(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` arg0, int arg1, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg2) `                                                                                                                                     | | ` void`                                                                                              | ` startIntentSenderForResult(`[IntentSender](https://developer.android.com/reference/android/content/IntentSender.html)` arg0, int arg1, `[Intent](https://developer.android.com/reference/android/content/Intent.html)` arg2, int arg3, int arg4, int arg5, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` arg6) ` | | ` void`                                                                                              | ` startPostponedEnterTransition() `                                                                                                                                                                                                                                                                                                             | | ` String`                                                                                            | ` toString() `                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                                              | ` unregisterForContextMenu(`[View](https://developer.android.com/reference/android/view/View.html)` arg0) `                                                                                                                                                                                                                                     | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` `[android.content.DialogInterface.OnCancelListener](https://developer.android.com/reference/android/content/DialogInterface.OnCancelListener.html)` ` |------------------|----------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onCancel(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` arg0) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` `[android.content.DialogInterface.OnDismissListener](https://developer.android.com/reference/android/content/DialogInterface.OnDismissListener.html)` ` |------------------|-----------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onDismiss(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` arg0) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` `[android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html)` ` |------------------|----------------------------| | ` abstract void` | ` onTrimMemory(int arg0) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` `[android.view.View.OnCreateContextMenuListener](https://developer.android.com/reference/android/view/View.OnCreateContextMenuListener.html)` ` |------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onCreateContextMenu(`[ContextMenu](https://developer.android.com/reference/android/view/ContextMenu.html)` arg0, `[View](https://developer.android.com/reference/android/view/View.html)` arg1, `[ContextMenu.ContextMenuInfo](https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html)` arg2) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` `[android.content.DialogInterface.OnClickListener](https://developer.android.com/reference/android/content/DialogInterface.OnClickListener.html)` ` |------------------|-------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onClick(`[DialogInterface](https://developer.android.com/reference/android/content/DialogInterface.html)` arg0, int arg1) ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#)From interface` `[android.content.ComponentCallbacks](https://developer.android.com/reference/android/content/ComponentCallbacks.html)` ` |------------------|------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` onConfigurationChanged(`[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)` arg0) ` | | ` abstract void` | ` onLowMemory() `                                                                                                                  | ||

## Constants

### ARG_KEY

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ARG_KEY
```

<br />

<br />

Constant Value: "key"

## Public constructors

### PreferenceDialogFragment

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
PreferenceDialogFragment ()
```

<br />

<br />

## Public methods

### getPreference

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
DialogPreference getPreference ()
```

Get the preference that requested this dialog. Available after[onCreate(Bundle)](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment#onCreate(android.os.Bundle))has been called on the[PreferenceFragment](https://developer.android.com/reference/android/support/v14/preference/PreferenceFragment)which launched this dialog.

<br />

|                                                                                                                           Returns                                                                                                                            ||
|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| [DialogPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference) | The[DialogPreference](https://developer.android.com/reference/android/support/v7/preference/DialogPreference)associated with this dialog. <br /> |

### onClick

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onClick (DialogInterface dialog, 
                int which)
```

<br />

<br />

|             Parameters             ||
|----------|--------------------------|
| `dialog` | `DialogInterface` <br /> |
| `which`  | `int` <br />             |

### onCreate

```
void onCreate (Bundle savedInstanceState)
```

<br />

<br />

|              Parameters               ||
|----------------------|-----------------|
| `savedInstanceState` | `Bundle` <br /> |

### onCreateDialog

```
Dialog onCreateDialog (Bundle savedInstanceState)
```

<br />

<br />

|              Parameters               ||
|----------------------|-----------------|
| `savedInstanceState` | `Bundle` <br /> |

|                                      Returns                                      ||
|---------------------------------------------------------------------------|--------|
| [Dialog](https://developer.android.com/reference/android/app/Dialog.html) | <br /> |

### onDialogClosed

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onDialogClosed (boolean positiveResult)
```

<br />

<br />

|             Parameters             ||
|------------------|------------------|
| `positiveResult` | `boolean` <br /> |

### onDismiss

```
void onDismiss (DialogInterface dialog)
```

<br />

<br />

|             Parameters             ||
|----------|--------------------------|
| `dialog` | `DialogInterface` <br /> |

### onSaveInstanceState

```
void onSaveInstanceState (Bundle outState)
```

<br />

<br />

|         Parameters          ||
|------------|-----------------|
| `outState` | `Bundle` <br /> |

## Protected methods

### onBindDialogView

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onBindDialogView (View view)
```

Binds views in the content View of the dialog to data.

Make sure to call through to the superclass implementation.

<br />

|                               Parameters                                ||
|--------|-----------------------------------------------------------------|
| `view` | `View`: The content View of the dialog, if it is custom. <br /> |

### onCreateDialogView

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
View onCreateDialogView (Context context)
```

Creates the content view for the dialog (if a custom content view is required). By default, it inflates the dialog layout resource if it is set.

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |

|                                                     Returns                                                     ||
|------------------------------------------------------------------------|-----------------------------------------|
| [View](https://developer.android.com/reference/android/view/View.html) | The content View for the dialog. <br /> |

**See also:**

- [setLayoutResource(int)](https://developer.android.com/reference/android/support/v7/preference/Preference#setLayoutResource(int))  

### onPrepareDialogBuilder

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onPrepareDialogBuilder (AlertDialog.Builder builder)
```

Prepares the dialog builder to be shown when the preference is clicked. Use this to set custom properties on the dialog.

Do not[create()](https://developer.android.com/reference/android/app/AlertDialog.Builder.html#create())or[show()](https://developer.android.com/reference/android/app/AlertDialog.Builder.html#show()).

<br />

|               Parameters                ||
|-----------|------------------------------|
| `builder` | `AlertDialog.Builder` <br /> |

-

  ## Interfaces

  - [PreferenceFragment.OnPreferenceDisplayDialogCallback](https://developer.android.com/reference/android/support/v14/preference/PreferenceFragment.OnPreferenceDisplayDialogCallback)
  - [PreferenceFragment.OnPreferenceStartFragmentCallback](https://developer.android.com/reference/android/support/v14/preference/PreferenceFragment.OnPreferenceStartFragmentCallback)
  - [PreferenceFragment.OnPreferenceStartScreenCallback](https://developer.android.com/reference/android/support/v14/preference/PreferenceFragment.OnPreferenceStartScreenCallback)
-

  ## Classes

  - [EditTextPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/EditTextPreferenceDialogFragment)
  - [ListPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/ListPreferenceDialogFragment)
  - [MultiSelectListPreference](https://developer.android.com/reference/android/support/v14/preference/MultiSelectListPreference)
  - [MultiSelectListPreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/MultiSelectListPreferenceDialogFragment)
  - [PreferenceDialogFragment](https://developer.android.com/reference/android/support/v14/preference/PreferenceDialogFragment)
  - [PreferenceFragment](https://developer.android.com/reference/android/support/v14/preference/PreferenceFragment)
  - [R](https://developer.android.com/reference/android/support/v14/preference/R)
  - [R.anim](https://developer.android.com/reference/android/support/v14/preference/R.anim)
  - [R.attr](https://developer.android.com/reference/android/support/v14/preference/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/v14/preference/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/v14/preference/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/v14/preference/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/v14/preference/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/v14/preference/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/v14/preference/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/v14/preference/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/v14/preference/R.string)
  - [R.style](https://developer.android.com/reference/android/support/v14/preference/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/v14/preference/R.styleable)
  - [SwitchPreference](https://developer.android.com/reference/android/support/v14/preference/SwitchPreference)