public final class PreferenceScreen
extends PreferenceGroup

   ↳ androidx.preference.Preference
     ↳ androidx.preference.PreferenceGroup
       ↳ androidx.preference.PreferenceScreen

A top-level container that represents a settings screen. This is the root component of your Preference hierarchy. A PreferenceFragmentCompat points to an instance of this class to show the preferences. To instantiate this class, use PreferenceManager.createPreferenceScreen(Context).

Developer Guides

For information about building a settings screen using the AndroidX Preference library, see Settings.


Inherited constants

Public methods

void setShouldUseGeneratedIds(boolean shouldUseGeneratedIds)

Set whether the adapter created for this screen should attempt to use the preference IDs generated by PreferenceGroup.addPreference(Preference) as stable item IDs.

boolean shouldUseGeneratedIds()

See setShouldUseGeneratedIds(boolean)

Protected methods

boolean isOnSameScreenAsChildren()

Whether this preference group should be shown on the same screen as its contained preferences.

void onClick()

Processes a click on the preference.

Inherited methods