5.3.5. Preferences
In Section 5.2.2, you changed the app’s settings to customize the quiz. A PreferenceFragment
uses Preference objects (package android.preference
) to manage these settings. This app uses Preference
subclass ListPreference to manage the number of guess Button
s displayed for each flag and Preference
subclass MultiSelectListPreference to manage the world regions to include in the quiz. A ListPreference
’s items are mutually exclusive, whereas any number of items can be selected in a MultiSelectListPreference
. You’ll use a PreferenceManager object (package android.preference
) to access and interact with the app’s preferences.
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.