Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

PreferenceManager

open class PreferenceManager
kotlin.Any
   ↳ androidx.preference.PreferenceManager

Used to help create Preference hierarchies from activities or XML.

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

Summary

Nested classes
abstract

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

abstract

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

abstract

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

abstract

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

open

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

Constants
static String

Public methods
open PreferenceScreen!

open T?

Finds a Preference with the given key.

open Context!

Returns the context.

open static SharedPreferences!

Gets a SharedPreferences instance that points to the default file that is used by the preference framework in the given context.

open PreferenceManager.OnDisplayPreferenceDialogListener!

open PreferenceManager.OnNavigateToScreenListener!

Returns the PreferenceManager.OnNavigateToScreenListener, if one has been set.

open PreferenceManager.OnPreferenceTreeClickListener!

open PreferenceManager.PreferenceComparisonCallback!

open PreferenceDataStore?

Returns the PreferenceDataStore associated with this manager or null if the default SharedPreferences are used instead.

open PreferenceScreen!

Returns the root of the preference hierarchy managed by this class.

open SharedPreferences!

Gets a SharedPreferences instance that preferences managed by this will use.

open Int

Returns the current mode of the SharedPreferences file that preferences managed by this will use.

open String!

Returns the current name of the SharedPreferences file that preferences managed by this will use.

open Boolean

Indicates if the storage location used internally by this class is the default provided by the hosting Context.

open Boolean

Indicates if the storage location used internally by this class is backed by device-protected storage.

open static Unit
setDefaultValues(context: Context!, resId: Int, readAgain: Boolean)

Sets the default values from an XML preference file by reading the values defined by each Preference item's android:defaultValue attribute.

open static Unit
setDefaultValues(context: Context!, sharedPreferencesName: String!, sharedPreferencesMode: Int, resId: Int, readAgain: Boolean)

Similar to setDefaultValues(Context, int, boolean) but allows the client to provide the filename and mode of the shared preferences file.

open Unit

open Unit

Sets the callback to be invoked when a PreferenceScreen in the hierarchy rooted at this PreferenceManager is clicked.

open Unit