1. Android. Preference. Preference
Represents the basic preference UI building block displayed byPreferenceactivity
In the form ofListview
. This class providesView
To be displayed in the activity and associates withSharedpreferences
To store/retrieve the preference data.
When specifying a preference hierarchy in XML, each element can point to a subclassPreference
, Similar to the view hierarchy and layouts.
This class containsKey
That will be used as the key intoSharedpreferences
. It is up to the subclass to decide how to store the value.
The preferenceactivity is displayed as a listview. This class provides a method to display the view in the activity, and uses the sharedprederence object to store/retrieve preference data.
In the actual XML layout file, you can use the specific subclass of preference.
This class contains the key used as the key value in sharedpreference. Generally, the subclass determines how to store values.