# PreferenceCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# PreferenceCategory

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/preference/PreferenceCategory "View this page in Java")  

```
open class PreferenceCategory : PreferenceGroup
```

|---|---|---|--------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                       ||||
| ↳ | [android.preference.Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)                        |||
|   | ↳ | [android.preference.PreferenceGroup](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup)           ||
|   |   | ↳ | [android.preference.PreferenceCategory](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#) |

*** ** * ** ***

| **This class was deprecated in API level 29.**
|
| Use the[AndroidX](https://developer.android.com/jetpack/androidx.html)[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary.html)for consistent behavior across all devices. For more information on using the AndroidX Preference Library see[Settings](https://developer.android.com/guide/topics/ui/settings.html).

Used to group[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)objects and provide a disabled title above the group.
|
| ### Developer Guides
|
| For information about building a settings UI with Preferences, read the[Settings](https://developer.android.com/guide/topics/ui/settings.html)guide.

<br />

## Summary

| Inherited XML attributes ||
|---|---|
| From class[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference) |---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [android:defaultValue](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)      | The default value for the preference, which will be set either if persistence is off or persistence is on and the preference is not found in the persistent storage. May be a reference to another resource, in the form "`@[+][`*package* `:]`*type* `/`*name*" or a theme attribute in the form "`?[`*package* `:]`*type* `/`*name*". May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character; May be an integer value, such as "`100`". May be a boolean value, such as "`true`" or "`false`". May be a floating point value, such as "`1.2`". <br /> | | [android:dependency](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)        | The key of another Preference that this Preference will depend on. If the other Preference is not set or is off, this Preference will be disabled. May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character; <br />                                                                                                                                                                                                                                                                                                                                       | | [android:enabled](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)           | Whether the Preference is enabled. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [android:fragment](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)          | When used inside of a modern PreferenceActivity, this declares a new PreferenceFragment to be shown when the user selects this item. May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character; <br />                                                                                                                                                                                                                                                                                                                                                     | | [android:icon](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)              | The optional icon for the preference. May be a reference to another resource, in the form "`@[+][`*package* `:]`*type* `/`*name*" or a theme attribute in the form "`?[`*package* `:]`*type* `/`*name*". <br />                                                                                                                                                                                                                                                                                                                                                                                                   | | [android:iconSpaceReserved](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference) | Whether the space for the preference icon view will be reserved. By default, preference icon view visibility will be set to GONE when there is no icon provided, so the default value of this attribute is false. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                   | | [android:key](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)               | The key to store the Preference value. May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character; <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [android:layout](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)            | The layout for the Preference in a PreferenceActivity screen. This should rarely need to be changed, look at widgetLayout instead. May be a reference to another resource, in the form "`@[+][`*package* `:]`*type* `/`*name*" or a theme attribute in the form "`?[`*package* `:]`*type* `/`*name*". <br />                                                                                                                                                                                                                                                                                                      | | [android:order](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)             | The order for the Preference (lower values are to be ordered first). If this is not specified, the default ordering will be alphabetic. May be an integer value, such as "`100`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                          | | [android:persistent](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)        | Whether the Preference stores its value to the storage. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [android:recycleEnabled](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)    | Whether the preference has enabled to have its view recycled when used in the list view. This is true by default. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [android:selectable](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)        | Whether the Preference is selectable. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [android:shouldDisableView](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference) | Whether the view of this Preference should be disabled when this Preference is disabled. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [android:singleLineTitle](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)   | Whether to use single line for the preference title text. By default, preference title will be constrained to one line, so the default value of this attribute is true. May be a boolean value, such as "`true`" or "`false`". <br />                                                                                                                                                                                                                                                                                                                                                                             | | [android:summary](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)           | The summary for the Preference. In API 25 and earlier, this value is read as a plain string with styling information stripped. May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character; <br />                                                                                                                                                                                                                                                                                                                                                           | | [android:title](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)             | The title for the Preference. In API 25 and earlier, this value is read as a plain string with styling information stripped. May be a string value, using '\\\\;' to escape characters such as '\\\\n' or '\\\\uxxxx' for a unicode character; <br />                                                                                                                                                                                                                                                                                                                                                             | | [android:widgetLayout](https://developer.android.com/reference/kotlin/android/preference/Preference#attr_Preference)      | The layout for the controllable widget portion of a Preference. This is inflated into the layout for a Preference and should be used more frequently than the layout attribute. For example, a checkbox preference would specify a custom layout (consisting of just the CheckBox) here. May be a reference to another resource, in the form "`@[+][`*package* `:]`*type* `/`*name*" or a theme attribute in the form "`?[`*package* `:]`*type* `/`*name*". <br />                                                                                                                                                | ||
| From class[PreferenceGroup](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup) |-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [android:orderingFromXml](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#attr_PreferenceGroup) | Whether to order the Preference under this group as they appear in the XML file. If this is false, the ordering will follow the Preference order attribute and default to alphabetic for those without the order attribute. May be a boolean value, such as "`true`" or "`false`". <br /> | ||

| Inherited constants ||
|---|---|
| From class[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [DEFAULT_ORDER](https://developer.android.com/reference/kotlin/android/preference/Preference#DEFAULT_ORDER:kotlin.Int) <br /> Specify for[setOrder(int)](https://developer.android.com/reference/kotlin/android/preference/Preference#setOrder(kotlin.Int))if a specific order is not required. <br /> | ||

|                                                                                                                                                                                                                                                                                                            Public constructors                                                                                                                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [PreferenceCategory](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#PreferenceCategory(android.content.Context))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`)` <br />                                                                                                                                                                                                                                                                                                                                                                 |
| [PreferenceCategory](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#PreferenceCategory(android.content.Context,%20android.util.AttributeSet))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`, `attrs:` `[AttributeSet](https://developer.android.com/reference/kotlin/android/util/AttributeSet.html#)!`)` <br />                                                                                                                                                                                                                        |
| [PreferenceCategory](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#PreferenceCategory(android.content.Context,%20android.util.AttributeSet,%20kotlin.Int))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`, `attrs:` `[AttributeSet](https://developer.android.com/reference/kotlin/android/util/AttributeSet.html#)!`, `defStyleAttr:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                            |
| [PreferenceCategory](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#PreferenceCategory(android.content.Context,%20android.util.AttributeSet,%20kotlin.Int,%20kotlin.Int))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`, `attrs:` `[AttributeSet](https://developer.android.com/reference/kotlin/android/util/AttributeSet.html#)!`, `defStyleAttr:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `defStyleRes:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> |

|                                                                                                                Public methods                                                                                                                ||
|----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnabled](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#isEnabled())`()` <br />                             |
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [shouldDisableDependents](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#shouldDisableDependents())`()` <br /> |

|                                                                                                                                                                                 Protected methods                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onPrepareAddPreference](https://developer.android.com/reference/kotlin/android/preference/PreferenceCategory#onPrepareAddPreference(android.preference.Preference))`(`preference:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`)` <br /> |

| Inherited functions ||
|---|---|
| From class[PreferenceGroup](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup) |---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [addItemFromInflater](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#addItemFromInflater(android.preference.Preference))`(`preference:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`)` <br /> Called by the inflater to add an item to this group. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [addPreference](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#addPreference(android.preference.Preference))`(`preference:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`)` <br /> Adds a[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)at the correct position based on the preference's order. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [dispatchRestoreInstanceState](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#dispatchRestoreInstanceState(android.os.Bundle))`(`container:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [dispatchSaveInstanceState](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#dispatchSaveInstanceState(android.os.Bundle))`(`container:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)! | [findPreference](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#findPreference(kotlin.CharSequence))`(`key:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` <br /> Finds a[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)based on its key. If two[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)share the same key (not recommended), the first to appear will be returned (to retrieve the other preference with the same key, call this method on the first preference). If this preference has the key, it will not be returned. This will recursively search for the preference into children that are also[PreferenceGroups](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup). <br /> | | [Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)! | [getPreference](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#getPreference(kotlin.Int))`(`index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Returns the[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)at a particular index. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                  | [getPreferenceCount](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#getPreferenceCount())`()` <br /> Returns the number of children[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)s. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [isOnSameScreenAsChildren](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#isOnSameScreenAsChildren())`()` <br /> Whether this preference group should be shown on the same screen as its contained preferences. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [isOrderingAsAdded](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#isOrderingAsAdded())`()` <br /> Whether this group is ordering preferences in the order they are added. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [notifyDependencyChange](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#notifyDependencyChange(kotlin.Boolean))`(`disableDependents:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [onAttachedToActivity](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#onAttachedToActivity())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [onPrepareForRemoval](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#onPrepareForRemoval())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [removeAll](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#removeAll())`()` <br /> Removes all[Preferences](https://developer.android.com/reference/kotlin/android/preference/Preference)from this group. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)          | [removePreference](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#removePreference(android.preference.Preference))`(`preference:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`)` <br /> Removes a[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)from this group. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                | [setOrderingAsAdded](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#setOrderingAsAdded(kotlin.Boolean))`(`orderingAsAdded:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Whether to order the[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)children of this group as they are added. If this is false, the ordering will follow each Preference order and default to alphabetic for those without an order. If this is called after preferences are added, they will not be re-ordered in the order they were added, hence call this method early on. <br />                                                                                                                                                                                                              | ||
| From class[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference) |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [callChangeListener](https://developer.android.com/reference/kotlin/android/preference/Preference#callChangeListener(kotlin.Any))`(`newValue:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` <br /> Call this method after the user changes the preference, but before the internal state is set. This allows the client to ignore the user value. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                | [compareTo](https://developer.android.com/reference/kotlin/android/preference/Preference#compareTo(android.preference.Preference))`(`other:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`)` <br /> Compares Preference objects based on order (if set), otherwise alphabetically on the titles. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!                                                                                               | [findPreferenceInHierarchy](https://developer.android.com/reference/kotlin/android/preference/Preference#findPreferenceInHierarchy(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Finds a Preference in this hierarchy (the whole thing, even above/below your[PreferenceScreen](https://developer.android.com/reference/kotlin/android/preference/PreferenceScreen)screen break) with the given key. This only functions after we have been attached to a hierarchy. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!                                                                                                  | [getContext](https://developer.android.com/reference/kotlin/android/preference/Preference#getContext())`()` <br /> Returns the[android.content.Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)of this Preference. Each Preference in a Preference hierarchy can be from different Context (for example, if multiple activities provide preferences into a single[PreferenceActivity](https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity)). This Context will be used to save the Preference values. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                         | [getDependency](https://developer.android.com/reference/kotlin/android/preference/Preference#getDependency())`()` <br /> Returns the key of the dependency on this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [SharedPreferences.Editor](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.Editor.html#)!                                                                | [getEditor](https://developer.android.com/reference/kotlin/android/preference/Preference#getEditor())`()` <br /> Returns an[SharedPreferences.Editor](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.Editor.html#)where this Preference can save its value(s). Usually it's easier to use one of the helper save methods:[persistBoolean(boolean)](https://developer.android.com/reference/kotlin/android/preference/Preference#persistBoolean(kotlin.Boolean)),[persistFloat(float)](https://developer.android.com/reference/kotlin/android/preference/Preference#persistFloat(kotlin.Float)),[persistInt(int)](https://developer.android.com/reference/kotlin/android/preference/Preference#persistInt(kotlin.Int)),[persistLong(long)](https://developer.android.com/reference/kotlin/android/preference/Preference#persistLong(kotlin.Long)),[persistString(java.lang.String)](https://developer.android.com/reference/kotlin/android/preference/Preference#persistString(kotlin.String)). To read values, see[getSharedPreferences()](https://developer.android.com/reference/kotlin/android/preference/Preference#getSharedPreferences()). If[shouldCommit()](https://developer.android.com/reference/kotlin/android/preference/Preference#shouldCommit())returns true, it is this Preference's responsibility to commit. In some cases, writes to this will not be committed right away and hence not show up in the SharedPreferences, this is intended behavior to improve performance. <br />                                                               | | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!                                                                                                         | [getExtras](https://developer.android.com/reference/kotlin/android/preference/Preference#getExtras())`()` <br /> Return the extras Bundle object associated with this preference, creating a new Bundle if there currently isn't one. You can use this to get and set individual extra key/value pairs. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                         | [getFragment](https://developer.android.com/reference/kotlin/android/preference/Preference#getFragment())`()` <br /> Return the fragment class name associated with this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Drawable](https://developer.android.com/reference/kotlin/android/graphics/drawable/Drawable.html#)!                                                                                      | [getIcon](https://developer.android.com/reference/kotlin/android/preference/Preference#getIcon())`()` <br /> Returns the icon of this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)!                                                                                                    | [getIntent](https://developer.android.com/reference/kotlin/android/preference/Preference#getIntent())`()` <br /> Return the[Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)associated with this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                         | [getKey](https://developer.android.com/reference/kotlin/android/preference/Preference#getKey())`()` <br /> Gets the key for this Preference, which is also the key used for storing values into[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)or[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                | [getLayoutResource](https://developer.android.com/reference/kotlin/android/preference/Preference#getLayoutResource())`()` <br /> Gets the layout resource that will be shown as the[View](https://developer.android.com/reference/kotlin/android/view/View.html#)for this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Preference.OnPreferenceChangeListener](https://developer.android.com/reference/kotlin/android/preference/Preference.OnPreferenceChangeListener)!                                         | [getOnPreferenceChangeListener](https://developer.android.com/reference/kotlin/android/preference/Preference#getOnPreferenceChangeListener())`()` <br /> Returns the callback to be invoked when this Preference is changed by the user (but before the internal state has been updated). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Preference.OnPreferenceClickListener](https://developer.android.com/reference/kotlin/android/preference/Preference.OnPreferenceClickListener)!                                           | [getOnPreferenceClickListener](https://developer.android.com/reference/kotlin/android/preference/Preference#getOnPreferenceClickListener())`()` <br /> Returns the callback to be invoked when this Preference is clicked. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                | [getOrder](https://developer.android.com/reference/kotlin/android/preference/Preference#getOrder())`()` <br /> Gets the order of this Preference with respect to other Preference objects on the same level. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [PreferenceGroup](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup)?                                                                                     | [getParent](https://developer.android.com/reference/kotlin/android/preference/Preference#getParent())`()` <br /> Returns the[PreferenceGroup](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup)which is this Preference assigned to or`null`if this preference is not assigned to any group or is a root Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [getPersistedBoolean](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedBoolean(kotlin.Boolean))`(`defaultReturnValue:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Attempts to get a persisted boolean if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)                                                                                                            | [getPersistedFloat](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedFloat(kotlin.Float))`(`defaultReturnValue:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` <br /> Attempts to get a persisted float if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                | [getPersistedInt](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedInt(kotlin.Int))`(`defaultReturnValue:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Attempts to get a persisted int if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)                                                                                                              | [getPersistedLong](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedLong(kotlin.Long))`(`defaultReturnValue:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Attempts to get a persisted long if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                                                                                                         | [getPersistedString](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedString(kotlin.String))`(`defaultReturnValue:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Attempts to get a persisted String if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>! | [getPersistedStringSet](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedStringSet(kotlin.collections.MutableSet))`(`defaultReturnValue:` `[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>!`)` <br /> Attempts to get a persisted set of Strings if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)?                                                                             | [getPreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/Preference#getPreferenceDataStore())`()` <br /> Returns[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)used by this Preference. Returns`null`if[android.content.SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)is used instead. By default preferences always use[android.content.SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#). To make this preference to use the[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)you need to assign your implementation to the Preference itself via[setPreferenceDataStore(android.preference.PreferenceDataStore)](https://developer.android.com/reference/kotlin/android/preference/Preference#setPreferenceDataStore(android.preference.PreferenceDataStore))or to its[PreferenceManager](https://developer.android.com/reference/kotlin/android/preference/PreferenceManager)via[PreferenceManager.setPreferenceDataStore(PreferenceDataStore)](https://developer.android.com/reference/kotlin/android/preference/PreferenceManager#setPreferenceDataStore(android.preference.PreferenceDataStore)). <br />                                                                                                                                                                                                           | | [PreferenceManager](https://developer.android.com/reference/kotlin/android/preference/PreferenceManager)!                                                                                 | [getPreferenceManager](https://developer.android.com/reference/kotlin/android/preference/Preference#getPreferenceManager())`()` <br /> Gets the[PreferenceManager](https://developer.android.com/reference/kotlin/android/preference/PreferenceManager)that manages this Preference object's tree. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)!                                                                              | [getSharedPreferences](https://developer.android.com/reference/kotlin/android/preference/Preference#getSharedPreferences())`()` <br /> Returns the[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)where this Preference can read its value(s). Usually, it's easier to use one of the helper read methods:[getPersistedBoolean(boolean)](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedBoolean(kotlin.Boolean)),[getPersistedFloat(float)](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedFloat(kotlin.Float)),[getPersistedInt(int)](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedInt(kotlin.Int)),[getPersistedLong(long)](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedLong(kotlin.Long)),[getPersistedString(java.lang.String)](https://developer.android.com/reference/kotlin/android/preference/Preference#getPersistedString(kotlin.String)). To save values, see[getEditor()](https://developer.android.com/reference/kotlin/android/preference/Preference#getEditor()). In some cases, writes to the[getEditor()](https://developer.android.com/reference/kotlin/android/preference/Preference#getEditor())will not be committed right away and hence not show up in the returned[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#), this is intended behavior to improve performance. <br /> | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [getShouldDisableView](https://developer.android.com/reference/kotlin/android/preference/Preference#getShouldDisableView())`()` <br /> Checks whether this Preference should disable its view when it's action is disabled. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!                                                                                            | [getSummary](https://developer.android.com/reference/kotlin/android/preference/Preference#getSummary())`()` <br /> Returns the summary of this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!                                                                                            | [getTitle](https://developer.android.com/reference/kotlin/android/preference/Preference#getTitle())`()` <br /> Returns the title of this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                | [getTitleRes](https://developer.android.com/reference/kotlin/android/preference/Preference#getTitleRes())`()` <br /> Returns the title resource ID of this Preference. If the title did not come from a resource,`0`is returned. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [View](https://developer.android.com/reference/kotlin/android/view/View.html#)!                                                                                                           | [getView](https://developer.android.com/reference/kotlin/android/preference/Preference#getView(android.view.View,%20android.view.ViewGroup))`(`convertView:` `[View](https://developer.android.com/reference/kotlin/android/view/View.html#)!`, `parent:` `[ViewGroup](https://developer.android.com/reference/kotlin/android/view/ViewGroup.html#)!`)` <br /> Gets the View that will be shown in the[PreferenceActivity](https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                | [getWidgetLayoutResource](https://developer.android.com/reference/kotlin/android/preference/Preference#getWidgetLayoutResource())`()` <br /> Gets the layout resource for the controllable widget portion of this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [hasKey](https://developer.android.com/reference/kotlin/android/preference/Preference#hasKey())`()` <br /> Checks whether this Preference has a valid key. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [isEnabled](https://developer.android.com/reference/kotlin/android/preference/Preference#isEnabled())`()` <br /> Checks whether this Preference should be enabled in the list. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [isIconSpaceReserved](https://developer.android.com/reference/kotlin/android/preference/Preference#isIconSpaceReserved())`()` <br /> Gets whether the space this preference icon view is reserved. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [isPersistent](https://developer.android.com/reference/kotlin/android/preference/Preference#isPersistent())`()` <br /> Checks whether this Preference is persistent. If it is, it stores its value(s) into the persistent[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)storage by default or into[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)if assigned. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [isRecycleEnabled](https://developer.android.com/reference/kotlin/android/preference/Preference#isRecycleEnabled())`()` <br /> Checks whether this Preference has enabled to have its view recycled when used in the list view. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [isSelectable](https://developer.android.com/reference/kotlin/android/preference/Preference#isSelectable())`()` <br /> Checks whether this Preference should be selectable in the list. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [isSingleLineTitle](https://developer.android.com/reference/kotlin/android/preference/Preference#isSingleLineTitle())`()` <br /> Gets whether the title of this preference is constrained to a single line. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [notifyChanged](https://developer.android.com/reference/kotlin/android/preference/Preference#notifyChanged())`()` <br /> Should be called when the data of this[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)has changed. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [notifyHierarchyChanged](https://developer.android.com/reference/kotlin/android/preference/Preference#notifyHierarchyChanged())`()` <br /> Should be called when a Preference has been added/removed from this group, or the ordering should be re-evaluated. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onAttachedToHierarchy](https://developer.android.com/reference/kotlin/android/preference/Preference#onAttachedToHierarchy(android.preference.PreferenceManager))`(`preferenceManager:` `[PreferenceManager](https://developer.android.com/reference/kotlin/android/preference/PreferenceManager)!`)` <br /> Called when this Preference has been attached to a Preference hierarchy. Make sure to call the super implementation. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onBindView](https://developer.android.com/reference/kotlin/android/preference/Preference#onBindView(android.view.View))`(`view:` `[View](https://developer.android.com/reference/kotlin/android/view/View.html#)!`)` <br /> Binds the created View to the data for this Preference. This is a good place to grab references to custom Views in the layout and set properties on them. Make sure to call through to the superclass's implementation. If you override this method you*must*call through to the superclass implementation. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onClick](https://developer.android.com/reference/kotlin/android/preference/Preference#onClick())`()` <br /> Processes a click on the preference. This includes saving the value to the[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#). However, the overridden method should call[callChangeListener(java.lang.Object)](https://developer.android.com/reference/kotlin/android/preference/Preference#callChangeListener(kotlin.Any))to make sure the client wants to update the preference's state with the new value. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [View](https://developer.android.com/reference/kotlin/android/view/View.html#)!                                                                                                           | [onCreateView](https://developer.android.com/reference/kotlin/android/preference/Preference#onCreateView(android.view.ViewGroup))`(`parent:` `[ViewGroup](https://developer.android.com/reference/kotlin/android/view/ViewGroup.html#)!`)` <br /> Creates the View to be shown for this Preference in the[PreferenceActivity](https://developer.android.com/reference/kotlin/android/preference/PreferenceActivity). The default behavior is to inflate the main layout of this Preference (see[setLayoutResource(int)](https://developer.android.com/reference/kotlin/android/preference/Preference#setLayoutResource(kotlin.Int)). If changing this behavior, please specify a[ViewGroup](https://developer.android.com/reference/kotlin/android/view/ViewGroup.html#)with ID[android.R.id#widget_frame](https://developer.android.com/reference/kotlin/android/R.id.html#widget_frame:kotlin.Int). Make sure to call through to the superclass's implementation. If you override this method you*must*call through to the superclass implementation. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onDependencyChanged](https://developer.android.com/reference/kotlin/android/preference/Preference#onDependencyChanged(android.preference.Preference,%20kotlin.Boolean))`(`dependency:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`, `disableDependent:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Called when the dependency changes. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!                                                                                                               | [onGetDefaultValue](https://developer.android.com/reference/kotlin/android/preference/Preference#onGetDefaultValue(android.content.res.TypedArray,%20kotlin.Int))`(`a:` `[TypedArray](https://developer.android.com/reference/kotlin/android/content/res/TypedArray.html#)!`, `index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Called when a Preference is being inflated and the default value attribute needs to be read. Since different Preference types have different value types, the subclass should get and return the default value which will be its value type. For example, if the value type is String, the body of the method would proxy to[TypedArray.getString(int)](https://developer.android.com/reference/kotlin/android/content/res/TypedArray.html#getString(kotlin.Int)). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onParentChanged](https://developer.android.com/reference/kotlin/android/preference/Preference#onParentChanged(android.preference.Preference,%20kotlin.Boolean))`(`parent:` `[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!`, `disableChild:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Called when the implicit parent dependency changes. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onRestoreInstanceState](https://developer.android.com/reference/kotlin/android/preference/Preference#onRestoreInstanceState(android.os.Parcelable))`(`state:` `[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#)!`)` <br /> Hook allowing a Preference to re-apply a representation of its internal state that had previously been generated by[onSaveInstanceState](https://developer.android.com/reference/kotlin/android/preference/Preference#onSaveInstanceState()). This function will never be called with a`null`state. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#)!                                                                                                 | [onSaveInstanceState](https://developer.android.com/reference/kotlin/android/preference/Preference#onSaveInstanceState())`()` <br /> Hook allowing a Preference to generate a representation of its internal state that can later be used to create a new instance with that same state. This state should only contain information that is not persistent or can be reconstructed later. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [onSetInitialValue](https://developer.android.com/reference/kotlin/android/preference/Preference#onSetInitialValue(kotlin.Boolean,%20kotlin.Any))`(`restorePersistedValue:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `defaultValue:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` <br /> Implement this to set the initial value of the Preference. If restorePersistedValue is true, you should restore the Preference value from the[android.content.SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#). If restorePersistedValue is false, you should set the Preference value to defaultValue that is given (and possibly store to SharedPreferences if[shouldPersist()](https://developer.android.com/reference/kotlin/android/preference/Preference#shouldPersist())is true). In case of using[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore), the restorePersistedValue is always`true`. But the default value (if provided) is set. This may not always be called. One example is if it should not persist but there is no default value given. <br />                                                                                                                                                                                                                                                                                                                                     | | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!                                                                                                         | [peekExtras](https://developer.android.com/reference/kotlin/android/preference/Preference#peekExtras())`()` <br /> Return the extras Bundle object associated with this preference, returning`null`if there is not currently one. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [persistBoolean](https://developer.android.com/reference/kotlin/android/preference/Preference#persistBoolean(kotlin.Boolean))`(`value:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Attempts to persist a boolean if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [persistFloat](https://developer.android.com/reference/kotlin/android/preference/Preference#persistFloat(kotlin.Float))`(`value:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` <br /> Attempts to persist a long if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [persistInt](https://developer.android.com/reference/kotlin/android/preference/Preference#persistInt(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Attempts to persist an int if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [persistLong](https://developer.android.com/reference/kotlin/android/preference/Preference#persistLong(kotlin.Long))`(`value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Attempts to persist a long if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [persistString](https://developer.android.com/reference/kotlin/android/preference/Preference#persistString(kotlin.String))`(`value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Attempts to persist a String if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [persistStringSet](https://developer.android.com/reference/kotlin/android/preference/Preference#persistStringSet(kotlin.collections.MutableSet))`(`values:` `[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>!`)` <br /> Attempts to persist a set of Strings if this Preference is persistent. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [restoreHierarchyState](https://developer.android.com/reference/kotlin/android/preference/Preference#restoreHierarchyState(android.os.Bundle))`(`container:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` <br /> Restore this Preference hierarchy's previously saved state from the given container. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [saveHierarchyState](https://developer.android.com/reference/kotlin/android/preference/Preference#saveHierarchyState(android.os.Bundle))`(`container:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)!`)` <br /> Store this Preference hierarchy's frozen state into the given container. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setDefaultValue](https://developer.android.com/reference/kotlin/android/preference/Preference#setDefaultValue(kotlin.Any))`(`defaultValue:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` <br /> Sets the default value for this Preference, which will be set either if persistence is off or persistence is on and the preference is not found in the persistent storage. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setDependency](https://developer.android.com/reference/kotlin/android/preference/Preference#setDependency(kotlin.String))`(`dependencyKey:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the key of a Preference that this Preference will depend on. If that Preference is not set or is off, this Preference will be disabled. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setEnabled](https://developer.android.com/reference/kotlin/android/preference/Preference#setEnabled(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether this Preference is enabled. If disabled, it will not handle clicks. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setFragment](https://developer.android.com/reference/kotlin/android/preference/Preference#setFragment(kotlin.String))`(`fragment:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the class name of a fragment to be shown when this Preference is clicked. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setIcon](https://developer.android.com/reference/kotlin/android/preference/Preference#setIcon(android.graphics.drawable.Drawable))`(`icon:` `[Drawable](https://developer.android.com/reference/kotlin/android/graphics/drawable/Drawable.html#)!`)` <br /> Sets the icon for this Preference with a Drawable. This icon will be placed into the ID[android.R.id#icon](https://developer.android.com/reference/kotlin/android/R.id.html#icon:kotlin.Int)within the View created by[onCreateView(android.view.ViewGroup)](https://developer.android.com/reference/kotlin/android/preference/Preference#onCreateView(android.view.ViewGroup)). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setIcon](https://developer.android.com/reference/kotlin/android/preference/Preference#setIcon(kotlin.Int))`(`iconResId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the icon for this Preference with a resource ID. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setIconSpaceReserved](https://developer.android.com/reference/kotlin/android/preference/Preference#setIconSpaceReserved(kotlin.Boolean))`(`iconSpaceReserved:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether to reserve the space of this Preference icon view when no icon is provided. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setIntent](https://developer.android.com/reference/kotlin/android/preference/Preference#setIntent(android.content.Intent))`(`intent:` `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)!`)` <br /> Sets an[Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)to be used for[Context.startActivity(Intent)](https://developer.android.com/reference/kotlin/android/content/Context.html#startActivity(android.content.Intent))when this Preference is clicked. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setKey](https://developer.android.com/reference/kotlin/android/preference/Preference#setKey(kotlin.String))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the key for this Preference, which is used as a key to the[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)or[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore). This should be unique for the package. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setLayoutResource](https://developer.android.com/reference/kotlin/android/preference/Preference#setLayoutResource(kotlin.Int))`(`layoutResId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the layout resource that is inflated as the[View](https://developer.android.com/reference/kotlin/android/view/View.html#)to be shown for this Preference. In most cases, the default layout is sufficient for custom Preference objects and only the widget layout needs to be changed. This layout should contain a[ViewGroup](https://developer.android.com/reference/kotlin/android/view/ViewGroup.html#)with ID[android.R.id#widget_frame](https://developer.android.com/reference/kotlin/android/R.id.html#widget_frame:kotlin.Int)to be the parent of the specific widget for this Preference. It should similarly contain[android.R.id#title](https://developer.android.com/reference/kotlin/android/R.id.html#title:kotlin.Int)and[android.R.id#summary](https://developer.android.com/reference/kotlin/android/R.id.html#summary:kotlin.Int). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setOnPreferenceChangeListener](https://developer.android.com/reference/kotlin/android/preference/Preference#setOnPreferenceChangeListener(android.preference.Preference.OnPreferenceChangeListener))`(`onPreferenceChangeListener:` `[Preference.OnPreferenceChangeListener](https://developer.android.com/reference/kotlin/android/preference/Preference.OnPreferenceChangeListener)!`)` <br /> Sets the callback to be invoked when this Preference is changed by the user (but before the internal state has been updated). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setOnPreferenceClickListener](https://developer.android.com/reference/kotlin/android/preference/Preference#setOnPreferenceClickListener(android.preference.Preference.OnPreferenceClickListener))`(`onPreferenceClickListener:` `[Preference.OnPreferenceClickListener](https://developer.android.com/reference/kotlin/android/preference/Preference.OnPreferenceClickListener)!`)` <br /> Sets the callback to be invoked when this Preference is clicked. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setOrder](https://developer.android.com/reference/kotlin/android/preference/Preference#setOrder(kotlin.Int))`(`order:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the order of this Preference with respect to other Preference objects on the same level. If this is not specified, the default behavior is to sort alphabetically. The[PreferenceGroup.setOrderingAsAdded(boolean)](https://developer.android.com/reference/kotlin/android/preference/PreferenceGroup#setOrderingAsAdded(kotlin.Boolean))can be used to order Preference objects based on the order they appear in the XML. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setPersistent](https://developer.android.com/reference/kotlin/android/preference/Preference#setPersistent(kotlin.Boolean))`(`persistent:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether this Preference is persistent. When persistent, it stores its value(s) into the persistent[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)storage by default or into[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)if assigned. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setPreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/Preference#setPreferenceDataStore(android.preference.PreferenceDataStore))`(`dataStore:` `[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)!`)` <br /> Sets a[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)to be used by this Preference instead of using[android.content.SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#). The data store will remain assigned even if the Preference is moved around the preference hierarchy. It will also override a data store propagated from the[PreferenceManager](https://developer.android.com/reference/kotlin/android/preference/PreferenceManager)that owns this Preference. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setRecycleEnabled](https://developer.android.com/reference/kotlin/android/preference/Preference#setRecycleEnabled(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether this Preference has enabled to have its view recycled when used in the list view. By default the recycling is enabled. The value can be changed only before this preference is added to the preference hierarchy. If view recycling is not allowed then each time the list view populates this preference the[getView(android.view.View,android.view.ViewGroup)](https://developer.android.com/reference/kotlin/android/preference/Preference#getView(android.view.View,%20android.view.ViewGroup))method receives a`null`convert view and needs to recreate the view. Otherwise view gets recycled and only[onBindView(android.view.View)](https://developer.android.com/reference/kotlin/android/preference/Preference#onBindView(android.view.View))gets called. If you override this method you*must*call through to the superclass implementation. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setSelectable](https://developer.android.com/reference/kotlin/android/preference/Preference#setSelectable(kotlin.Boolean))`(`selectable:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether this Preference is selectable. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setShouldDisableView](https://developer.android.com/reference/kotlin/android/preference/Preference#setShouldDisableView(kotlin.Boolean))`(`shouldDisableView:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether this Preference should disable its view when it gets disabled. For example, set this and[setEnabled(boolean)](https://developer.android.com/reference/kotlin/android/preference/Preference#setEnabled(kotlin.Boolean))to false for preferences that are only displaying information and 1) should not be clickable 2) should not have the view set to the disabled state. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setSingleLineTitle](https://developer.android.com/reference/kotlin/android/preference/Preference#setSingleLineTitle(kotlin.Boolean))`(`singleLineTitle:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> Sets whether to constrain the title of this Preference to a single line instead of letting it wrap onto multiple lines. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setSummary](https://developer.android.com/reference/kotlin/android/preference/Preference#setSummary(kotlin.Int))`(`summaryResId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the summary for this Preference with a resource ID. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setSummary](https://developer.android.com/reference/kotlin/android/preference/Preference#setSummary(kotlin.CharSequence))`(`summary:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` <br /> Sets the summary for this Preference with a CharSequence. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setTitle](https://developer.android.com/reference/kotlin/android/preference/Preference#setTitle(kotlin.Int))`(`titleResId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the title for this Preference with a resource ID. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setTitle](https://developer.android.com/reference/kotlin/android/preference/Preference#setTitle(kotlin.CharSequence))`(`title:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` <br /> Sets the title for this Preference with a CharSequence. This title will be placed into the ID[android.R.id#title](https://developer.android.com/reference/kotlin/android/R.id.html#title:kotlin.Int)within the View created by[onCreateView(android.view.ViewGroup)](https://developer.android.com/reference/kotlin/android/preference/Preference#onCreateView(android.view.ViewGroup)). <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                              | [setWidgetLayoutResource](https://developer.android.com/reference/kotlin/android/preference/Preference#setWidgetLayoutResource(kotlin.Int))`(`widgetLayoutResId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets the layout for the controllable widget portion of this Preference. This is inflated into the main layout. For example, a[CheckBoxPreference](https://developer.android.com/reference/kotlin/android/preference/CheckBoxPreference)would specify a custom layout (consisting of just the CheckBox) here, instead of creating its own main layout. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [shouldCommit](https://developer.android.com/reference/kotlin/android/preference/Preference#shouldCommit())`()` <br /> Returns whether the[Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)should commit its saved value(s) in[getEditor()](https://developer.android.com/reference/kotlin/android/preference/Preference#getEditor()). This may return false in situations where batch committing is being done (by the manager) to improve performance. If this preference is using[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)this value is irrelevant. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [shouldDisableDependents](https://developer.android.com/reference/kotlin/android/preference/Preference#shouldDisableDependents())`()` <br /> Checks whether this preference's dependents should currently be disabled. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                        | [shouldPersist](https://developer.android.com/reference/kotlin/android/preference/Preference#shouldPersist())`()` <br /> Checks whether, at the given time this method is called, this Preference should store/restore its value(s) into the[SharedPreferences](https://developer.android.com/reference/kotlin/android/content/SharedPreferences.html#)or into[PreferenceDataStore](https://developer.android.com/reference/kotlin/android/preference/PreferenceDataStore)if assigned. This, at minimum, checks whether this Preference is persistent and it currently has a key. Before you save/restore from the storage, check this first. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                          | [toString](https://developer.android.com/reference/kotlin/android/preference/Preference#toString())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | ||

## Public constructors

### PreferenceCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PreferenceCategory(context: Context!)
```  

### PreferenceCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PreferenceCategory(
    context: Context!, 
    attrs: AttributeSet!)
```  

### PreferenceCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PreferenceCategory(
    context: Context!, 
    attrs: AttributeSet!, 
    defStyleAttr: Int)
```  

### PreferenceCategory

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PreferenceCategory(
    context: Context!, 
    attrs: AttributeSet!, 
    defStyleAttr: Int, 
    defStyleRes: Int)
```

## Public methods

### isEnabled

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun isEnabled(): Boolean
```

**Deprecated:** *Deprecated in Java.*

|                                                                  Return                                                                  ||
|------------------------------------------------------------------------------------|------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this Preference is enabled, false otherwise |

### shouldDisableDependents

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun shouldDisableDependents(): Boolean
```

**Deprecated:** *Deprecated in Java.*

|                                                                     Return                                                                      ||
|------------------------------------------------------------------------------------|-------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | True if the dependents should be disabled, otherwise false. |

## Protected methods

### onPrepareAddPreference

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
protected open fun onPrepareAddPreference(preference: Preference!): Boolean
```

**Deprecated:** *Deprecated in Java.*

|                                                            Parameters                                                            ||
|--------------|--------------------------------------------------------------------------------------------------------------------|
| `preference` | [Preference](https://developer.android.com/reference/kotlin/android/preference/Preference)!:The preference to add. |

|                                                                       Return                                                                       ||
|------------------------------------------------------------------------------------|----------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | Whether to allow adding the preference (true), or not (false). |