In the previous example of Android Apidemo example parsing (9): App->activity->persistent state describes the use of shared preferences to store some states, shared A more general use of preferences is to store some application preferences (settings). Package Android.preference provides many classes that allow applications to display and set application-related preferences. Of course, you can use a custom UI to configure these program preferences. But using classes defined in Android.preference can give users a unified UI (consistent with the settings of Android itself).
Typically, program preferences are performed using separate activity (derived from preferenceactivity). In Preferenceactivity, Preferencescreen is the root element of layout, which can contain other such as: Checkboxpreference, Edittextpreference, Listpreference, Preferencecategory or ringtonpreference. When using preference, all program preferences are automatically saved in the application's sharedpreferences, and applications can access these preferences through Getsharedpreferences ().
Checkboxpreference uses a checkbox to display a configuration item.
Edittextpreference uses a text box to display a sign item that allows you to accept user input text.
Listpreference use a set of radio buttons (lists) from which you can select an item.
Multiselectlistpreference uses a set of checkbox to allow the configuration item to have multiple values.
Ringtonpreference allows the user to select a ringtone from
The base class for these classes is preference, it is a base class, and you can define a custom preference.
Preferencegroup can define a group for multiple preference, preferencecategory, Preferencescreen for its subclasses.
Preferencecategory can also contain multiple preferneces, which can provide a title if the group is disable.
Preferencescreen is the root element of the preferences hierarchy, Preferencescreen can be nested. The inner Preferencescreen will use a new on-screen display, somewhat similar to the paging functionality in Word.
Preferences from XML describes using XML to define application preferences, and uses preferenceactivity to display this preference.