# PreferenceFragment

Artifact: [androidx.preference:preference](https://developer.android.com/jetpack/androidx/releases/preference) [View Source](https://cs.android.com/search?q=file:androidx/preference/PreferenceFragment.java+class:androidx.preference.PreferenceFragment) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

*** ** * ** ***


```
public abstract class PreferenceFragment extends Fragment implements PreferenceManager.OnPreferenceTreeClickListener, PreferenceManager.OnDisplayPreferenceDialogListener, PreferenceManager.OnNavigateToScreenListener, DialogPreference.TargetFragment
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) ||
|   | ↳ | [androidx.preference.PreferenceFragment](https://developer.android.com/reference/androidx/preference/PreferenceFragment) |

Known direct subclasses [BaseLeanbackPreferenceFragment](https://developer.android.com/reference/androidx/leanback/preference/BaseLeanbackPreferenceFragment)

|---|---|
| `https://developer.android.com/reference/androidx/leanback/preference/BaseLeanbackPreferenceFragment` | **This class is deprecated.** Use `https://developer.android.com/reference/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat` <br /> |

Known indirect subclasses [LeanbackPreferenceFragment](https://developer.android.com/reference/androidx/leanback/preference/LeanbackPreferenceFragment)

|---|---|
| `https://developer.android.com/reference/androidx/leanback/preference/LeanbackPreferenceFragment` | **This class is deprecated.** Use `https://developer.android.com/reference/androidx/leanback/preference/LeanbackPreferenceFragmentCompat` <br /> |

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Shows a hierarchy of `https://developer.android.com/reference/androidx/preference/Preference` objects as lists. These preferences will automatically save to `https://developer.android.com/reference/android/content/SharedPreferences.html` as the user interacts with them. To retrieve an instance of `https://developer.android.com/reference/android/content/SharedPreferences.html` that the preference hierarchy in this fragment will use, call `https://developer.android.com/reference/androidx/preference/PreferenceManager#getDefaultSharedPreferences(android.content.Context)` with a context in the same package as this fragment.

Furthermore, the preferences shown will follow the visual style of system preferences. It is easy to create a hierarchy of preferences (that can be shown on multiple screens) via XML. For these reasons, it is recommended to use this fragment (as a superclass) to deal with preferences in applications.

A `https://developer.android.com/reference/androidx/preference/PreferenceScreen` object should be at the top of the preference hierarchy. Furthermore, subsequent `https://developer.android.com/reference/androidx/preference/PreferenceScreen` in the hierarchy denote a screen break--that is the preferences contained within subsequent `https://developer.android.com/reference/androidx/preference/PreferenceScreen` should be shown on another screen. The preference framework handles this by calling `https://developer.android.com/reference/androidx/preference/PreferenceFragment#onNavigateToScreen(androidx.preference.PreferenceScreen)`.

The preference hierarchy can be formed in multiple ways:

- From an XML file specifying the hierarchy
- From different `https://developer.android.com/reference/android/app/Activity.html` that each specify its own preferences in an XML file via `https://developer.android.com/reference/android/app/Activity.html` meta-data
- From an object hierarchy rooted with `https://developer.android.com/reference/androidx/preference/PreferenceScreen`

To inflate from XML, use the `https://developer.android.com/reference/androidx/preference/PreferenceFragment#addPreferencesFromResource(int)`. The root element should be a `https://developer.android.com/reference/androidx/preference/PreferenceScreen`. Subsequent elements can point to actual `https://developer.android.com/reference/androidx/preference/Preference` subclasses. As mentioned above, subsequent `https://developer.android.com/reference/androidx/preference/PreferenceScreen` in the hierarchy will result in the screen break.

To specify an object hierarchy rooted with `https://developer.android.com/reference/androidx/preference/PreferenceScreen`, use `https://developer.android.com/reference/androidx/preference/PreferenceFragment#setPreferenceScreen(androidx.preference.PreferenceScreen)`.

As a convenience, this fragment implements a click listener for any preference in the current hierarchy, see `https://developer.android.com/reference/androidx/preference/PreferenceFragment#onPreferenceTreeClick(androidx.preference.Preference)`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/preference/Preference` |   |
| `https://developer.android.com/reference/androidx/preference/PreferenceScreen` |   |

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/preference/PreferenceFragment.OnPreferenceDisplayDialogCallback` **This interface is deprecated.** Deprecated in Java |
| `public interface https://developer.android.com/reference/androidx/preference/PreferenceFragment.OnPreferenceStartFragmentCallback` **This interface is deprecated.** Deprecated in Java |
| `public interface https://developer.android.com/reference/androidx/preference/PreferenceFragment.OnPreferenceStartScreenCallback` **This interface is deprecated.** Deprecated in Java |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/preference/PreferenceFragment#ARG_PREFERENCE_ROOT() = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT"` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |

| ### Public constructors |
|---|
| `[PreferenceFragment](https://developer.android.com/reference/androidx/preference/PreferenceFragment#PreferenceFragment())()` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `void` | `[addPreferencesFromResource](https://developer.android.com/reference/androidx/preference/PreferenceFragment#addPreferencesFromResource(int))(@https://developer.android.com/reference/androidx/annotation/XmlRes int preferencesResId)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `T` | `<T extends https://developer.android.com/reference/androidx/preference/Preference> [findPreference](https://developer.android.com/reference/androidx/preference/PreferenceFragment#findPreference(java.lang.CharSequence))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html key)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `final https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView` | `[getListView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#getListView())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `https://developer.android.com/reference/androidx/preference/PreferenceManager` | `[getPreferenceManager](https://developer.android.com/reference/androidx/preference/PreferenceFragment#getPreferenceManager())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `https://developer.android.com/reference/androidx/preference/PreferenceScreen` | `[getPreferenceScreen](https://developer.android.com/reference/androidx/preference/PreferenceFragment#getPreferenceScreen())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[onCreate](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreate(android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` **This method is deprecated.** |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager` | `[onCreateLayoutManager](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateLayoutManager())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `abstract void` | `[onCreatePreferences](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreatePreferences(android.os.Bundle,java.lang.String))(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState, https://developer.android.com/reference/java/lang/String.html rootKey)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView` | `[onCreateRecyclerView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateRecyclerView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/ViewGroup.html parent, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html` | `[onCreateView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/LayoutInflater.html inflater, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/ViewGroup.html container, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState )` **This method is deprecated.** |
| `void` | `[onDestroyView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onDestroyView())()` **This method is deprecated.** |
| `void` | `[onDisplayPreferenceDialog](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onDisplayPreferenceDialog(androidx.preference.Preference))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/Preference preference)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[onNavigateToScreen](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onNavigateToScreen(androidx.preference.PreferenceScreen))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/PreferenceScreen preferenceScreen)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `boolean` | `[onPreferenceTreeClick](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onPreferenceTreeClick(androidx.preference.Preference))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/Preference preference)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[onSaveInstanceState](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onSaveInstanceState(android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html outState)` **This method is deprecated.** |
| `void` | `[onStart](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onStart())()` **This method is deprecated.** |
| `void` | `[onStop](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onStop())()` **This method is deprecated.** |
| `void` | `[onViewCreated](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onViewCreated(android.view.View,android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)` **This method is deprecated.** |
| `void` | `[scrollToPreference](https://developer.android.com/reference/androidx/preference/PreferenceFragment#scrollToPreference(java.lang.String))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html key)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[scrollToPreference](https://developer.android.com/reference/androidx/preference/PreferenceFragment#scrollToPreference(androidx.preference.Preference))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/Preference preference)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[setDivider](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setDivider(android.graphics.drawable.Drawable))(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/drawable/Drawable.html divider)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[setDividerHeight](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setDividerHeight(int))(int height)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[setPreferenceScreen](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setPreferenceScreen(androidx.preference.PreferenceScreen))(https://developer.android.com/reference/androidx/preference/PreferenceScreen preferenceScreen)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |
| `void` | `[setPreferencesFromResource](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setPreferencesFromResource(int,java.lang.String))( @https://developer.android.com/reference/androidx/annotation/XmlRes int preferencesResId, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html key )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |

| ### Protected methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter` | `[onCreateAdapter](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateAdapter(androidx.preference.PreferenceScreen))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/PreferenceScreen preferenceScreen)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead <br /> |

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40`

**This field is deprecated.** Deprecated in Java
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20`

**This field is deprecated.** Deprecated in Java

### Inherited methods

From [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) `void` `[dump](https://developer.android.com/reference/android/app/Fragment.html#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))(https://developer.android.com/reference/java/lang/String.html prefix, https://developer.android.com/reference/java/io/FileDescriptor.html fd, https://developer.android.com/reference/java/io/PrintWriter.html writer, String[] args)`

**This method is deprecated.**
`final boolean` `[equals](https://developer.android.com/reference/android/app/Fragment.html#equals(java.lang.Object))(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/Activity.html` `[getActivity](https://developer.android.com/reference/android/app/Fragment.html#getActivity())()`

**This method is deprecated.**
`boolean` `[getAllowEnterTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#getAllowEnterTransitionOverlap())()`

**This method is deprecated.**
`boolean` `[getAllowReturnTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#getAllowReturnTransitionOverlap())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/os/Bundle.html` `[getArguments](https://developer.android.com/reference/android/app/Fragment.html#getArguments())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/FragmentManager.html` `[getChildFragmentManager](https://developer.android.com/reference/android/app/Fragment.html#getChildFragmentManager())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/content/Context.html` `[getContext](https://developer.android.com/reference/android/app/Fragment.html#getContext())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#getEnterTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getExitTransition](https://developer.android.com/reference/android/app/Fragment.html#getExitTransition())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/FragmentManager.html` `[getFragmentManager](https://developer.android.com/reference/android/app/Fragment.html#getFragmentManager())()`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/Object.html` `[getHost](https://developer.android.com/reference/android/app/Fragment.html#getHost())()`

**This method is deprecated.**
`final int` `[getId](https://developer.android.com/reference/android/app/Fragment.html#getId())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/view/LayoutInflater.html` `[getLayoutInflater](https://developer.android.com/reference/android/app/Fragment.html#getLayoutInflater())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/app/LoaderManager.html` `[getLoaderManager](https://developer.android.com/reference/android/app/Fragment.html#getLoaderManager())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/Fragment.html` `[getParentFragment](https://developer.android.com/reference/android/app/Fragment.html#getParentFragment())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getReenterTransition](https://developer.android.com/reference/android/app/Fragment.html#getReenterTransition())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/content/res/Resources.html` `[getResources](https://developer.android.com/reference/android/app/Fragment.html#getResources())()`

**This method is deprecated.**
`final boolean` `[getRetainInstance](https://developer.android.com/reference/android/app/Fragment.html#getRetainInstance())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#getReturnTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getSharedElementEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#getSharedElementEnterTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/transition/Transition.html` `[getSharedElementReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#getSharedElementReturnTransition())()`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/String.html` `[getString](https://developer.android.com/reference/android/app/Fragment.html#getString(int))(int resId)`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/String.html` `[getTag](https://developer.android.com/reference/android/app/Fragment.html#getTag())()`

**This method is deprecated.**
`final https://developer.android.com/reference/android/app/Fragment.html` `[getTargetFragment](https://developer.android.com/reference/android/app/Fragment.html#getTargetFragment())()`

**This method is deprecated.**
`final int` `[getTargetRequestCode](https://developer.android.com/reference/android/app/Fragment.html#getTargetRequestCode())()`

**This method is deprecated.**
`final https://developer.android.com/reference/java/lang/CharSequence.html` `[getText](https://developer.android.com/reference/android/app/Fragment.html#getText(int))(int resId)`

**This method is deprecated.**
`boolean` `[getUserVisibleHint](https://developer.android.com/reference/android/app/Fragment.html#getUserVisibleHint())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/view/View.html` `[getView](https://developer.android.com/reference/android/app/Fragment.html#getView())()`

**This method is deprecated.**
`final int` `[hashCode](https://developer.android.com/reference/android/app/Fragment.html#hashCode())()`

**This method is deprecated.**
`static https://developer.android.com/reference/android/app/Fragment.html` `[instantiate](https://developer.android.com/reference/android/app/Fragment.html#instantiate(android.content.Context, java.lang.String))(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/java/lang/String.html fname)`

**This method is deprecated.**
`final boolean` `[isAdded](https://developer.android.com/reference/android/app/Fragment.html#isAdded())()`

**This method is deprecated.**
`final boolean` `[isDetached](https://developer.android.com/reference/android/app/Fragment.html#isDetached())()`

**This method is deprecated.**
`final boolean` `[isHidden](https://developer.android.com/reference/android/app/Fragment.html#isHidden())()`

**This method is deprecated.**
`final boolean` `[isInLayout](https://developer.android.com/reference/android/app/Fragment.html#isInLayout())()`

**This method is deprecated.**
`final boolean` `[isRemoving](https://developer.android.com/reference/android/app/Fragment.html#isRemoving())()`

**This method is deprecated.**
`final boolean` `[isResumed](https://developer.android.com/reference/android/app/Fragment.html#isResumed())()`

**This method is deprecated.**
`final boolean` `[isStateSaved](https://developer.android.com/reference/android/app/Fragment.html#isStateSaved())()`

**This method is deprecated.**
`final boolean` `[isVisible](https://developer.android.com/reference/android/app/Fragment.html#isVisible())()`

**This method is deprecated.**
`void` `[onActivityCreated](https://developer.android.com/reference/android/app/Fragment.html#onActivityCreated(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`void` `[onActivityResult](https://developer.android.com/reference/android/app/Fragment.html#onActivityResult(int, int, android.content.Intent))(int requestCode, int resultCode, https://developer.android.com/reference/android/content/Intent.html data)`

**This method is deprecated.**
`void` `[onAttach](https://developer.android.com/reference/android/app/Fragment.html#onAttach(android.app.Activity))(https://developer.android.com/reference/android/app/Activity.html activity)`

**This method is deprecated.**
`void` `[onAttachFragment](https://developer.android.com/reference/android/app/Fragment.html#onAttachFragment(android.app.Fragment))(https://developer.android.com/reference/android/app/Fragment.html childFragment)`

**This method is deprecated.**
`void` `[onConfigurationChanged](https://developer.android.com/reference/android/app/Fragment.html#onConfigurationChanged(android.content.res.Configuration))(https://developer.android.com/reference/android/content/res/Configuration.html newConfig)`

**This method is deprecated.**
`boolean` `[onContextItemSelected](https://developer.android.com/reference/android/app/Fragment.html#onContextItemSelected(android.view.MenuItem))(https://developer.android.com/reference/android/view/MenuItem.html item)`

**This method is deprecated.**
`https://developer.android.com/reference/android/animation/Animator.html` `[onCreateAnimator](https://developer.android.com/reference/android/app/Fragment.html#onCreateAnimator(int, boolean, int))(int transit, boolean enter, int nextAnim)`

**This method is deprecated.**
`void` `[onCreateContextMenu](https://developer.android.com/reference/android/app/Fragment.html#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo))(
https://developer.android.com/reference/android/view/ContextMenu.html menu,
https://developer.android.com/reference/android/view/View.html v,
https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html menuInfo
)`

**This method is deprecated.**
`void` `[onCreateOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))(https://developer.android.com/reference/android/view/Menu.html menu, https://developer.android.com/reference/android/view/MenuInflater.html inflater)`

**This method is deprecated.**
`void` `[onDestroy](https://developer.android.com/reference/android/app/Fragment.html#onDestroy())()`

**This method is deprecated.**
`void` `[onDestroyOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onDestroyOptionsMenu())()`

**This method is deprecated.**
`void` `[onDetach](https://developer.android.com/reference/android/app/Fragment.html#onDetach())()`

**This method is deprecated.**
`https://developer.android.com/reference/android/view/LayoutInflater.html` `[onGetLayoutInflater](https://developer.android.com/reference/android/app/Fragment.html#onGetLayoutInflater(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`void` `[onHiddenChanged](https://developer.android.com/reference/android/app/Fragment.html#onHiddenChanged(boolean))(boolean hidden)`

**This method is deprecated.**
`void` `[onInflate](https://developer.android.com/reference/android/app/Fragment.html#onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle))(
https://developer.android.com/reference/android/app/Activity.html activity,
https://developer.android.com/reference/android/util/AttributeSet.html attrs,
https://developer.android.com/reference/android/os/Bundle.html savedInstanceState
)`

**This method is deprecated.**
`void` `[onLowMemory](https://developer.android.com/reference/android/app/Fragment.html#onLowMemory())()`

**This method is deprecated.**
`void` `[onMultiWindowModeChanged](https://developer.android.com/reference/android/app/Fragment.html#onMultiWindowModeChanged(boolean))(boolean isInMultiWindowMode)`

**This method is deprecated.**
`boolean` `[onOptionsItemSelected](https://developer.android.com/reference/android/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem))(https://developer.android.com/reference/android/view/MenuItem.html item)`

**This method is deprecated.**
`void` `[onOptionsMenuClosed](https://developer.android.com/reference/android/app/Fragment.html#onOptionsMenuClosed(android.view.Menu))(https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**
`void` `[onPause](https://developer.android.com/reference/android/app/Fragment.html#onPause())()`

**This method is deprecated.**
`void` `[onPictureInPictureModeChanged](https://developer.android.com/reference/android/app/Fragment.html#onPictureInPictureModeChanged(boolean))(boolean isInPictureInPictureMode)`

**This method is deprecated.**
`void` `[onPrepareOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu))(https://developer.android.com/reference/android/view/Menu.html menu)`

**This method is deprecated.**
`void` `[onRequestPermissionsResult](https://developer.android.com/reference/android/app/Fragment.html#onRequestPermissionsResult(int, java.lang.String[], int[]))(
int requestCode,
String[] permissions,
int[] grantResults
)`

**This method is deprecated.**
`void` `[onResume](https://developer.android.com/reference/android/app/Fragment.html#onResume())()`

**This method is deprecated.**
`void` `[onTrimMemory](https://developer.android.com/reference/android/app/Fragment.html#onTrimMemory(int))(int level)`

**This method is deprecated.**
`void` `[onViewStateRestored](https://developer.android.com/reference/android/app/Fragment.html#onViewStateRestored(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState)`

**This method is deprecated.**
`void` `[postponeEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#postponeEnterTransition())()`

**This method is deprecated.**
`void` `[registerForContextMenu](https://developer.android.com/reference/android/app/Fragment.html#registerForContextMenu(android.view.View))(https://developer.android.com/reference/android/view/View.html view)`

**This method is deprecated.**
`final void` `[requestPermissions](https://developer.android.com/reference/android/app/Fragment.html#requestPermissions(java.lang.String[], int))(String[] permissions, int requestCode)`

**This method is deprecated.**
`void` `[setAllowEnterTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#setAllowEnterTransitionOverlap(boolean))(boolean allow)`

**This method is deprecated.**
`void` `[setAllowReturnTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#setAllowReturnTransitionOverlap(boolean))(boolean allow)`

**This method is deprecated.**
`void` `[setArguments](https://developer.android.com/reference/android/app/Fragment.html#setArguments(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html args)`

**This method is deprecated.**
`void` `[setEnterSharedElementCallback](https://developer.android.com/reference/android/app/Fragment.html#setEnterSharedElementCallback(android.app.SharedElementCallback))(https://developer.android.com/reference/android/app/SharedElementCallback.html callback)`

**This method is deprecated.**
`void` `[setEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#setEnterTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setExitSharedElementCallback](https://developer.android.com/reference/android/app/Fragment.html#setExitSharedElementCallback(android.app.SharedElementCallback))(https://developer.android.com/reference/android/app/SharedElementCallback.html callback)`

**This method is deprecated.**
`void` `[setExitTransition](https://developer.android.com/reference/android/app/Fragment.html#setExitTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setHasOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#setHasOptionsMenu(boolean))(boolean hasMenu)`

**This method is deprecated.**
`void` `[setInitialSavedState](https://developer.android.com/reference/android/app/Fragment.html#setInitialSavedState(android.app.Fragment.SavedState))(https://developer.android.com/reference/android/app/Fragment.SavedState.html state)`

**This method is deprecated.**
`void` `[setMenuVisibility](https://developer.android.com/reference/android/app/Fragment.html#setMenuVisibility(boolean))(boolean menuVisible)`

**This method is deprecated.**
`void` `[setReenterTransition](https://developer.android.com/reference/android/app/Fragment.html#setReenterTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setRetainInstance](https://developer.android.com/reference/android/app/Fragment.html#setRetainInstance(boolean))(boolean retain)`

**This method is deprecated.**
`void` `[setReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#setReturnTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setSharedElementEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#setSharedElementEnterTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setSharedElementReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#setSharedElementReturnTransition(android.transition.Transition))(https://developer.android.com/reference/android/transition/Transition.html transition)`

**This method is deprecated.**
`void` `[setTargetFragment](https://developer.android.com/reference/android/app/Fragment.html#setTargetFragment(android.app.Fragment, int))(https://developer.android.com/reference/android/app/Fragment.html fragment, int requestCode)`

**This method is deprecated.**
`void` `[setUserVisibleHint](https://developer.android.com/reference/android/app/Fragment.html#setUserVisibleHint(boolean))(boolean isVisibleToUser)`

**This method is deprecated.**
`boolean` `[shouldShowRequestPermissionRationale](https://developer.android.com/reference/android/app/Fragment.html#shouldShowRequestPermissionRationale(java.lang.String))(https://developer.android.com/reference/java/lang/String.html permission)`

**This method is deprecated.**
`void` `[startActivity](https://developer.android.com/reference/android/app/Fragment.html#startActivity(android.content.Intent))(https://developer.android.com/reference/android/content/Intent.html intent)`

**This method is deprecated.**
`void` `[startActivityForResult](https://developer.android.com/reference/android/app/Fragment.html#startActivityForResult(android.content.Intent, int))(https://developer.android.com/reference/android/content/Intent.html intent, int requestCode)`

**This method is deprecated.**
`void` `[startIntentSenderForResult](https://developer.android.com/reference/android/app/Fragment.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle))(
https://developer.android.com/reference/android/content/IntentSender.html intent,
int requestCode,
https://developer.android.com/reference/android/content/Intent.html fillInIntent,
int flagsMask,
int flagsValues,
int extraFlags,
https://developer.android.com/reference/android/os/Bundle.html options
)`

**This method is deprecated.**
`void` `[startPostponedEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#startPostponedEnterTransition())()`

**This method is deprecated.**
`https://developer.android.com/reference/java/lang/String.html` `[toString](https://developer.android.com/reference/android/app/Fragment.html#toString())()`

**This method is deprecated.**
`void` `[unregisterForContextMenu](https://developer.android.com/reference/android/app/Fragment.html#unregisterForContextMenu(android.view.View))(https://developer.android.com/reference/android/view/View.html view)`

**This method is deprecated.**

## Constants

### ARG_PREFERENCE_ROOT

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public static final String ARG_PREFERENCE_ROOT = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT"
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Fragment argument used to specify the tag of the desired root `https://developer.android.com/reference/androidx/preference/PreferenceScreen` object.

## Public constructors

### PreferenceFragment

Added in 1.0.0 Deprecated in 1.1.0

```
public [PreferenceFragment](https://developer.android.com/reference/androidx/preference/PreferenceFragment#PreferenceFragment())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

## Public methods

### addPreferencesFromResource

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [addPreferencesFromResource](https://developer.android.com/reference/androidx/preference/PreferenceFragment#addPreferencesFromResource(int))(@XmlRes int preferencesResId)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Inflates the given XML resource and adds the preference hierarchy to the current preference hierarchy.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/XmlRes int preferencesResId` | The XML resource ID to inflate |

### findPreference

Added in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01) Deprecated in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01)

```
public T <T extends Preference> [findPreference](https://developer.android.com/reference/androidx/preference/PreferenceFragment#findPreference(java.lang.CharSequence))(@NonNull CharSequence key)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Finds a `https://developer.android.com/reference/androidx/preference/Preference` based on its key.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html key` | The key of the preference to retrieve |

| Returns |
|---|---|
| `T` | The `https://developer.android.com/reference/androidx/preference/Preference` with the key, or null |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/preference/PreferenceGroup#findPreference(java.lang.CharSequence)` |   |

### getListView

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public final RecyclerView [getListView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#getListView())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

### getPreferenceManager

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public PreferenceManager [getPreferenceManager](https://developer.android.com/reference/androidx/preference/PreferenceFragment#getPreferenceManager())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Returns the `https://developer.android.com/reference/androidx/preference/PreferenceManager` used by this fragment.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/preference/PreferenceManager` | The `https://developer.android.com/reference/androidx/preference/PreferenceManager` used by this fragment |

### getPreferenceScreen

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public PreferenceScreen [getPreferenceScreen](https://developer.android.com/reference/androidx/preference/PreferenceFragment#getPreferenceScreen())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Gets the root of the preference hierarchy that this fragment is showing.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/preference/PreferenceScreen` | The `https://developer.android.com/reference/androidx/preference/PreferenceScreen` that is the root of the preference hierarchy |

### onCreate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [onCreate](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreate(android.os.Bundle))(@Nullable Bundle savedInstanceState)
```

> [!CAUTION]
> **This method is deprecated.**   

### onCreateLayoutManager

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public @NonNull RecyclerView.LayoutManager [onCreateLayoutManager](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateLayoutManager())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Called from `https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateRecyclerView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)` to create the `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager` for the created `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager` | A new `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager` instance |

### onCreatePreferences

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public abstract void [onCreatePreferences](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreatePreferences(android.os.Bundle,java.lang.String))(@Nullable Bundle savedInstanceState, String rootKey)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Called during `https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreate(android.os.Bundle)` to supply the preferences for this fragment. Subclasses are expected to call `https://developer.android.com/reference/androidx/preference/PreferenceFragment#setPreferenceScreen(androidx.preference.PreferenceScreen)` either directly or via helper methods such as `https://developer.android.com/reference/androidx/preference/PreferenceFragment#addPreferencesFromResource(int)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If the fragment is being re-created from a previous saved state, this is the state. |
| `https://developer.android.com/reference/java/lang/String.html rootKey` | If non-null, this preference fragment should be rooted at the `https://developer.android.com/reference/androidx/preference/PreferenceScreen` with this key. |

### onCreateRecyclerView

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public @NonNull RecyclerView [onCreateRecyclerView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateRecyclerView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle))(
    @NonNull LayoutInflater inflater,
    @NonNull ViewGroup parent,
    @Nullable Bundle savedInstanceState
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Creates the `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView` used to display the preferences. Subclasses may override this to return a customized `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/LayoutInflater.html inflater` | The LayoutInflater object that can be used to inflate the `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/ViewGroup.html parent` | The parent view that the RecyclerView will be attached to. This method should not add the view itself, but this can be used to generate the layout params of the view. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/os/Bundle.html savedInstanceState` | If non-null, this view is being re-constructed from a previous saved state as given here. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView` | A new `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView` object to be placed into the view hierarchy |

### onCreateView

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public @NonNull View [onCreateView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateView(android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle))(
    @NonNull LayoutInflater inflater,
    @Nullable ViewGroup container,
    @Nullable Bundle savedInstanceState
)
```

> [!CAUTION]
> **This method is deprecated.**   

### onDestroyView

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [onDestroyView](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onDestroyView())()
```

> [!CAUTION]
> **This method is deprecated.**   

### onDisplayPreferenceDialog

Added in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01) Deprecated in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01)

```
public void [onDisplayPreferenceDialog](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onDisplayPreferenceDialog(androidx.preference.Preference))(@NonNull Preference preference)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Called when a preference in the tree requests to display a dialog. Subclasses should override this method to display custom dialogs or to handle dialogs for custom preference classes.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/Preference preference` | The `https://developer.android.com/reference/androidx/preference/Preference` object requesting the dialog |

### onNavigateToScreen

Added in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01) Deprecated in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01)

```
public void [onNavigateToScreen](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onNavigateToScreen(androidx.preference.PreferenceScreen))(@NonNull PreferenceScreen preferenceScreen)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Called by `https://developer.android.com/reference/androidx/preference/PreferenceScreen#onClick()` in order to navigate to a new screen of preferences. Calls `https://developer.android.com/reference/androidx/preference/PreferenceFragment.OnPreferenceStartScreenCallback#onPreferenceStartScreen(androidx.preference.PreferenceFragment,androidx.preference.PreferenceScreen)` if the target fragment or containing activity implements `https://developer.android.com/reference/androidx/preference/PreferenceFragment.OnPreferenceStartScreenCallback`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/PreferenceScreen preferenceScreen` | The `https://developer.android.com/reference/androidx/preference/PreferenceScreen` to navigate to |

### onPreferenceTreeClick

Added in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01) Deprecated in [1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/preference#1.3.0-alpha01)

```
public boolean [onPreferenceTreeClick](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onPreferenceTreeClick(androidx.preference.Preference))(@NonNull Preference preference)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Called when a preference in the tree rooted at this has been clicked.

### onSaveInstanceState

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [onSaveInstanceState](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onSaveInstanceState(android.os.Bundle))(@NonNull Bundle outState)
```

> [!CAUTION]
> **This method is deprecated.**   

### onStart

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [onStart](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onStart())()
```

> [!CAUTION]
> **This method is deprecated.**   

### onStop

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [onStop](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onStop())()
```

> [!CAUTION]
> **This method is deprecated.**   

### onViewCreated

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [onViewCreated](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onViewCreated(android.view.View,android.os.Bundle))(@NonNull View view, @Nullable Bundle savedInstanceState)
```

> [!CAUTION]
> **This method is deprecated.**   

### scrollToPreference

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [scrollToPreference](https://developer.android.com/reference/androidx/preference/PreferenceFragment#scrollToPreference(java.lang.String))(@NonNull String key)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

### scrollToPreference

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [scrollToPreference](https://developer.android.com/reference/androidx/preference/PreferenceFragment#scrollToPreference(androidx.preference.Preference))(@NonNull Preference preference)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

### setDivider

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [setDivider](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setDivider(android.graphics.drawable.Drawable))(@Nullable Drawable divider)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Sets the `https://developer.android.com/reference/android/graphics/drawable/Drawable.html` that will be drawn between each item in the list.

**Note:** If the drawable does not have an intrinsic height, you should also call `https://developer.android.com/reference/androidx/preference/PreferenceFragment#setDividerHeight(int)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/drawable/Drawable.html divider` | The drawable to use `https://developer.android.com/reference/android/R.attr.html#divider` |

### setDividerHeight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [setDividerHeight](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setDividerHeight(int))(int height)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Sets the height of the divider that will be drawn between each item in the list. Calling this will override the intrinsic height as set by `https://developer.android.com/reference/androidx/preference/PreferenceFragment#setDivider(android.graphics.drawable.Drawable)`.

| Parameters |
|---|---|
| `int height` | The new height of the divider in pixels `https://developer.android.com/reference/android/R.attr.html#dividerHeight` |

### setPreferenceScreen

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [setPreferenceScreen](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setPreferenceScreen(androidx.preference.PreferenceScreen))(PreferenceScreen preferenceScreen)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Sets the root of the preference hierarchy that this fragment is showing.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/preference/PreferenceScreen preferenceScreen` | The root `https://developer.android.com/reference/androidx/preference/PreferenceScreen` of the preference hierarchy |

### setPreferencesFromResource

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
public void [setPreferencesFromResource](https://developer.android.com/reference/androidx/preference/PreferenceFragment#setPreferencesFromResource(int,java.lang.String))(
    @XmlRes int preferencesResId,
    @Nullable String key
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Inflates the given XML resource and replaces the current preference hierarchy (if any) with the preference hierarchy rooted at `key`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/XmlRes int preferencesResId` | The XML resource ID to inflate |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html key` | The preference key of the `https://developer.android.com/reference/androidx/preference/PreferenceScreen` to use as the root of the preference hierarchy, or `null` to use the root `https://developer.android.com/reference/androidx/preference/PreferenceScreen`. |

## Protected methods

### onCreateAdapter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/preference#1.0.0) Deprecated in [1.1.0](https://developer.android.com/jetpack/androidx/releases/preference#1.1.0)

```
protected @NonNull RecyclerView.Adapter [onCreateAdapter](https://developer.android.com/reference/androidx/preference/PreferenceFragment#onCreateAdapter(androidx.preference.PreferenceScreen))(@NonNull PreferenceScreen preferenceScreen)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat` instead

Creates the root adapter.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/preference/PreferenceScreen preferenceScreen` | The `https://developer.android.com/reference/androidx/preference/PreferenceScreen` object to create the adapter for |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter` | An adapter that contains the preferences contained in this `https://developer.android.com/reference/androidx/preference/PreferenceScreen` |