# 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)

*** ** * ** ***


```
abstract class PreferenceFragment : Fragment, PreferenceManager.OnPreferenceTreeClickListener, PreferenceManager.OnDisplayPreferenceDialogListener, PreferenceManager.OnNavigateToScreenListener, DialogPreference.TargetFragment
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) ||
|   | ↳ | [androidx.preference.PreferenceFragment](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment) |

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

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

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

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

*** ** * ** ***

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

Shows a hierarchy of `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/androidx/preference/PreferenceScreen` object should be at the top of the preference hierarchy. Furthermore, subsequent `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen` in the hierarchy denote a screen break--that is the preferences contained within subsequent `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen` should be shown on another screen. The preference framework handles this by calling `https://developer.android.com/reference/kotlin/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/kotlin/androidx/preference/PreferenceScreen`

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

To specify an object hierarchy rooted with `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen`, use `https://developer.android.com/reference/kotlin/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/kotlin/androidx/preference/PreferenceFragment#onPreferenceTreeClick(androidx.preference.Preference)`.

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

## Summary

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

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#ARG_PREFERENCE_ROOT() = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT"` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragmentCompat` instead <br /> |

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

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

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

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40`

**This property is deprecated.** Deprecated in Java
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This property is deprecated.**
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20`

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

### Inherited functions

From [android.app.Fragment](https://developer.android.com/reference/android/app/Fragment.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[dump](https://developer.android.com/reference/android/app/Fragment.html#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]))(
prefix: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!,
fd: https://developer.android.com/reference/java/io/FileDescriptor.html!,
writer: https://developer.android.com/reference/java/io/PrintWriter.html!,
args: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[equals](https://developer.android.com/reference/android/app/Fragment.html#equals(java.lang.Object))(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)`

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

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[getAllowEnterTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#getAllowEnterTransitionOverlap())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[getAllowReturnTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#getAllowReturnTransitionOverlap())()`

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

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

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

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

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

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

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` `[getHost](https://developer.android.com/reference/android/app/Fragment.html#getHost())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[getId](https://developer.android.com/reference/android/app/Fragment.html#getId())()`

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

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

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

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

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

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[getRetainInstance](https://developer.android.com/reference/android/app/Fragment.html#getRetainInstance())()`

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

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

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

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getString](https://developer.android.com/reference/android/app/Fragment.html#getString(int))(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[getTag](https://developer.android.com/reference/android/app/Fragment.html#getTag())()`

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

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[getTargetRequestCode](https://developer.android.com/reference/android/app/Fragment.html#getTargetRequestCode())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` `[getText](https://developer.android.com/reference/android/app/Fragment.html#getText(int))(resId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[getUserVisibleHint](https://developer.android.com/reference/android/app/Fragment.html#getUserVisibleHint())()`

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

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `[hashCode](https://developer.android.com/reference/android/app/Fragment.html#hashCode())()`

**This function is deprecated.**
`java-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))(context: https://developer.android.com/reference/android/content/Context.html!, fname: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isAdded](https://developer.android.com/reference/android/app/Fragment.html#isAdded())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isDetached](https://developer.android.com/reference/android/app/Fragment.html#isDetached())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isHidden](https://developer.android.com/reference/android/app/Fragment.html#isHidden())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isInLayout](https://developer.android.com/reference/android/app/Fragment.html#isInLayout())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isRemoving](https://developer.android.com/reference/android/app/Fragment.html#isRemoving())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isResumed](https://developer.android.com/reference/android/app/Fragment.html#isResumed())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isStateSaved](https://developer.android.com/reference/android/app/Fragment.html#isStateSaved())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[isVisible](https://developer.android.com/reference/android/app/Fragment.html#isVisible())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onActivityCreated](https://developer.android.com/reference/android/app/Fragment.html#onActivityCreated(android.os.Bundle))(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onActivityResult](https://developer.android.com/reference/android/app/Fragment.html#onActivityResult(int, int, android.content.Intent))(requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, data: https://developer.android.com/reference/android/content/Intent.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onAttach](https://developer.android.com/reference/android/app/Fragment.html#onAttach(android.app.Activity))(activity: https://developer.android.com/reference/android/app/Activity.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onAttachFragment](https://developer.android.com/reference/android/app/Fragment.html#onAttachFragment(android.app.Fragment))(childFragment: https://developer.android.com/reference/android/app/Fragment.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onConfigurationChanged](https://developer.android.com/reference/android/app/Fragment.html#onConfigurationChanged(android.content.res.Configuration))(newConfig: https://developer.android.com/reference/android/content/res/Configuration.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[onContextItemSelected](https://developer.android.com/reference/android/app/Fragment.html#onContextItemSelected(android.view.MenuItem))(item: https://developer.android.com/reference/android/view/MenuItem.html!)`

**This function 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))(transit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, enter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, nextAnim: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onCreateContextMenu](https://developer.android.com/reference/android/app/Fragment.html#onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo))(
menu: https://developer.android.com/reference/android/view/ContextMenu.html!,
v: https://developer.android.com/reference/android/view/View.html!,
menuInfo: https://developer.android.com/reference/android/view/ContextMenu.ContextMenuInfo.html!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onCreateOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater))(menu: https://developer.android.com/reference/android/view/Menu.html!, inflater: https://developer.android.com/reference/android/view/MenuInflater.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onDestroy](https://developer.android.com/reference/android/app/Fragment.html#onDestroy())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onDestroyOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onDestroyOptionsMenu())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onDetach](https://developer.android.com/reference/android/app/Fragment.html#onDetach())()`

**This function 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))(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onHiddenChanged](https://developer.android.com/reference/android/app/Fragment.html#onHiddenChanged(boolean))(hidden: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onInflate](https://developer.android.com/reference/android/app/Fragment.html#onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle))(
activity: https://developer.android.com/reference/android/app/Activity.html!,
attrs: https://developer.android.com/reference/android/util/AttributeSet.html!,
savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onLowMemory](https://developer.android.com/reference/android/app/Fragment.html#onLowMemory())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onMultiWindowModeChanged](https://developer.android.com/reference/android/app/Fragment.html#onMultiWindowModeChanged(boolean))(isInMultiWindowMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[onOptionsItemSelected](https://developer.android.com/reference/android/app/Fragment.html#onOptionsItemSelected(android.view.MenuItem))(item: https://developer.android.com/reference/android/view/MenuItem.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onOptionsMenuClosed](https://developer.android.com/reference/android/app/Fragment.html#onOptionsMenuClosed(android.view.Menu))(menu: https://developer.android.com/reference/android/view/Menu.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onPause](https://developer.android.com/reference/android/app/Fragment.html#onPause())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onPictureInPictureModeChanged](https://developer.android.com/reference/android/app/Fragment.html#onPictureInPictureModeChanged(boolean))(isInPictureInPictureMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onPrepareOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#onPrepareOptionsMenu(android.view.Menu))(menu: https://developer.android.com/reference/android/view/Menu.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onRequestPermissionsResult](https://developer.android.com/reference/android/app/Fragment.html#onRequestPermissionsResult(int, java.lang.String[], int[]))(
requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
permissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!,
grantResults: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onResume](https://developer.android.com/reference/android/app/Fragment.html#onResume())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onTrimMemory](https://developer.android.com/reference/android/app/Fragment.html#onTrimMemory(int))(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onViewStateRestored](https://developer.android.com/reference/android/app/Fragment.html#onViewStateRestored(android.os.Bundle))(savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[postponeEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#postponeEnterTransition())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[registerForContextMenu](https://developer.android.com/reference/android/app/Fragment.html#registerForContextMenu(android.view.View))(view: https://developer.android.com/reference/android/view/View.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[requestPermissions](https://developer.android.com/reference/android/app/Fragment.html#requestPermissions(java.lang.String[], int))(permissions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setAllowEnterTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#setAllowEnterTransitionOverlap(boolean))(allow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setAllowReturnTransitionOverlap](https://developer.android.com/reference/android/app/Fragment.html#setAllowReturnTransitionOverlap(boolean))(allow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setArguments](https://developer.android.com/reference/android/app/Fragment.html#setArguments(android.os.Bundle))(args: https://developer.android.com/reference/android/os/Bundle.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setEnterSharedElementCallback](https://developer.android.com/reference/android/app/Fragment.html#setEnterSharedElementCallback(android.app.SharedElementCallback))(callback: https://developer.android.com/reference/android/app/SharedElementCallback.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#setEnterTransition(android.transition.Transition))(transition: https://developer.android.com/reference/android/transition/Transition.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setExitSharedElementCallback](https://developer.android.com/reference/android/app/Fragment.html#setExitSharedElementCallback(android.app.SharedElementCallback))(callback: https://developer.android.com/reference/android/app/SharedElementCallback.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setExitTransition](https://developer.android.com/reference/android/app/Fragment.html#setExitTransition(android.transition.Transition))(transition: https://developer.android.com/reference/android/transition/Transition.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setHasOptionsMenu](https://developer.android.com/reference/android/app/Fragment.html#setHasOptionsMenu(boolean))(hasMenu: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setInitialSavedState](https://developer.android.com/reference/android/app/Fragment.html#setInitialSavedState(android.app.Fragment.SavedState))(state: https://developer.android.com/reference/android/app/Fragment.SavedState.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setMenuVisibility](https://developer.android.com/reference/android/app/Fragment.html#setMenuVisibility(boolean))(menuVisible: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setReenterTransition](https://developer.android.com/reference/android/app/Fragment.html#setReenterTransition(android.transition.Transition))(transition: https://developer.android.com/reference/android/transition/Transition.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setRetainInstance](https://developer.android.com/reference/android/app/Fragment.html#setRetainInstance(boolean))(retain: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#setReturnTransition(android.transition.Transition))(transition: https://developer.android.com/reference/android/transition/Transition.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setSharedElementEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#setSharedElementEnterTransition(android.transition.Transition))(transition: https://developer.android.com/reference/android/transition/Transition.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setSharedElementReturnTransition](https://developer.android.com/reference/android/app/Fragment.html#setSharedElementReturnTransition(android.transition.Transition))(transition: https://developer.android.com/reference/android/transition/Transition.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setTargetFragment](https://developer.android.com/reference/android/app/Fragment.html#setTargetFragment(android.app.Fragment, int))(fragment: https://developer.android.com/reference/android/app/Fragment.html!, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[setUserVisibleHint](https://developer.android.com/reference/android/app/Fragment.html#setUserVisibleHint(boolean))(isVisibleToUser: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[shouldShowRequestPermissionRationale](https://developer.android.com/reference/android/app/Fragment.html#shouldShowRequestPermissionRationale(java.lang.String))(permission: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startActivity](https://developer.android.com/reference/android/app/Fragment.html#startActivity(android.content.Intent))(intent: https://developer.android.com/reference/android/content/Intent.html!)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startActivityForResult](https://developer.android.com/reference/android/app/Fragment.html#startActivityForResult(android.content.Intent, int))(intent: https://developer.android.com/reference/android/content/Intent.html!, requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startIntentSenderForResult](https://developer.android.com/reference/android/app/Fragment.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int, android.os.Bundle))(
intent: https://developer.android.com/reference/android/content/IntentSender.html!,
requestCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
fillInIntent: https://developer.android.com/reference/android/content/Intent.html!,
flagsMask: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
flagsValues: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
extraFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
options: https://developer.android.com/reference/android/os/Bundle.html!
)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[startPostponedEnterTransition](https://developer.android.com/reference/android/app/Fragment.html#startPostponedEnterTransition())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `[toString](https://developer.android.com/reference/android/app/Fragment.html#toString())()`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[unregisterForContextMenu](https://developer.android.com/reference/android/app/Fragment.html#unregisterForContextMenu(android.view.View))(view: https://developer.android.com/reference/android/view/View.html!)`

**This function 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)

```
const val ARG_PREFERENCE_ROOT = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT": String!
```

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

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

## Public constructors

### PreferenceFragment

Added in 1.0.0 Deprecated in 1.1.0

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

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

## Public functions

### 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)

```
fun [addPreferencesFromResource](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#addPreferencesFromResource(int))(preferencesResId: @XmlRes Int): Unit
```

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

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

| Parameters |
|---|---|
| `preferencesResId: @https://developer.android.com/reference/kotlin/androidx/annotation/XmlRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | 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)

```
fun <T : Preference?> [findPreference](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#findPreference(java.lang.CharSequence))(key: CharSequence): T!
```

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

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

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | The key of the preference to retrieve |

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun [getListView](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#getListView())(): RecyclerView!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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)

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

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceManager!` | The `https://developer.android.com/reference/kotlin/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)

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

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen!` | The `https://developer.android.com/reference/kotlin/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)

```
fun [onCreate](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onCreate(android.os.Bundle))(savedInstanceState: Bundle?): Unit
```

> [!CAUTION]
> **This function 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)

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

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager` | A new `https://developer.android.com/reference/kotlin/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)

```
abstract fun [onCreatePreferences](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onCreatePreferences(android.os.Bundle,java.lang.String))(savedInstanceState: Bundle?, rootKey: String!): Unit
```

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

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

| Parameters |
|---|---|
| `savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?` | If the fragment is being re-created from a previous saved state, this is the state. |
| `rootKey: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | If non-null, this preference fragment should be rooted at the `https://developer.android.com/reference/kotlin/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)

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

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

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

| Parameters |
|---|---|
| `inflater: https://developer.android.com/reference/android/view/LayoutInflater.html` | The LayoutInflater object that can be used to inflate the `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView`. |
| `parent: https://developer.android.com/reference/android/view/ViewGroup.html` | 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. |
| `savedInstanceState: https://developer.android.com/reference/android/os/Bundle.html?` | If non-null, this view is being re-constructed from a previous saved state as given here. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView` | A new `https://developer.android.com/reference/kotlin/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)

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

> [!CAUTION]
> **This function 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)

```
fun [onDestroyView](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onDestroyView())(): Unit
```

> [!CAUTION]
> **This function 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)

```
fun [onDisplayPreferenceDialog](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onDisplayPreferenceDialog(androidx.preference.Preference))(preference: Preference): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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 |
|---|---|
| `preference: https://developer.android.com/reference/kotlin/androidx/preference/Preference` | The `https://developer.android.com/reference/kotlin/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)

```
fun [onNavigateToScreen](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onNavigateToScreen(androidx.preference.PreferenceScreen))(preferenceScreen: PreferenceScreen): Unit
```

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

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

| Parameters |
|---|---|
| `preferenceScreen: https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen` | The `https://developer.android.com/reference/kotlin/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)

```
fun [onPreferenceTreeClick](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onPreferenceTreeClick(androidx.preference.Preference))(preference: Preference): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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)

```
fun [onSaveInstanceState](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onSaveInstanceState(android.os.Bundle))(outState: Bundle): Unit
```

> [!CAUTION]
> **This function 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)

```
fun [onStart](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onStart())(): Unit
```

> [!CAUTION]
> **This function 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)

```
fun [onStop](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onStop())(): Unit
```

> [!CAUTION]
> **This function 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)

```
fun [onViewCreated](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onViewCreated(android.view.View,android.os.Bundle))(view: View, savedInstanceState: Bundle?): Unit
```

> [!CAUTION]
> **This function 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)

```
fun [scrollToPreference](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#scrollToPreference(java.lang.String))(key: String): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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)

```
fun [scrollToPreference](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#scrollToPreference(androidx.preference.Preference))(preference: Preference): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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)

```
fun [setDivider](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#setDivider(android.graphics.drawable.Drawable))(divider: Drawable?): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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/kotlin/androidx/preference/PreferenceFragment#setDividerHeight(int)`.

| Parameters |
|---|---|
| `divider: https://developer.android.com/reference/android/graphics/drawable/Drawable.html?` | 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)

```
fun [setDividerHeight](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#setDividerHeight(int))(height: Int): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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/kotlin/androidx/preference/PreferenceFragment#setDivider(android.graphics.drawable.Drawable)`.

| Parameters |
|---|---|
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | 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)

```
fun [setPreferenceScreen](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#setPreferenceScreen(androidx.preference.PreferenceScreen))(preferenceScreen: PreferenceScreen!): Unit
```

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

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

| Parameters |
|---|---|
| `preferenceScreen: https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen!` | The root `https://developer.android.com/reference/kotlin/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)

```
fun [setPreferencesFromResource](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#setPreferencesFromResource(int,java.lang.String))(preferencesResId: @XmlRes Int, key: String?): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/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 |
|---|---|
| `preferencesResId: @https://developer.android.com/reference/kotlin/androidx/annotation/XmlRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The XML resource ID to inflate |
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The preference key of the `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen` to use as the root of the preference hierarchy, or `null` to use the root `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceScreen`. |

## Protected functions

### 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 fun [onCreateAdapter](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragment#onCreateAdapter(androidx.preference.PreferenceScreen))(preferenceScreen: PreferenceScreen): RecyclerView.Adapter
```

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

Creates the root adapter.

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

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