public class PreferenceManager
extends Object

   ↳ androidx.preference.PreferenceManager

Used to help create Preference hierarchies from activities or XML.

In most cases, clients should use PreferenceFragmentCompat.addPreferencesFromResource(int).


Nested classes

interface PreferenceManager.OnDisplayPreferenceDialogListener

Interface definition for a class that will be called when a Preference requests to display a dialog. 

interface PreferenceManager.OnNavigateToScreenListener

Interface definition for a class that will be called when a PreferenceScreen requests navigation. 

interface PreferenceManager.OnPreferenceTreeClickListener

Interface definition for a callback to be invoked when a Preference in the hierarchy rooted at this PreferenceScreen is clicked. 

class PreferenceManager.PreferenceComparisonCallback

Callback class to be used by the RecyclerView.Adapter associated with the PreferenceScreen, used to determine when two Preference objects are semantically and visually the same. 

class PreferenceManager.SimplePreferenceComparisonCallback

A basic implementation of PreferenceManager.PreferenceComparisonCallback suitable for use with the default Preference classes. 



Public methods

PreferenceScreen createPreferenceScreen(Context context)
<T extends Preference> T findPreference(CharSequence key)

Finds a Preference with the given key.

Context getContext()

Returns the context.

static SharedPreferences