Exploring the Preferences Framework
Before we dig into Android's preferences framework, let's establish a scenario that would require the use of preferences and then explore how we would go about addressing it. Suppose you are writing an application that provides a facility to search for airline flights. Moreover, suppose that the application's default setting is to display flights based on the lowest cost, but the user can set a preference to always sort flights by the least number of stops or by a specific airline. How would you go about doing that?
Understanding ListPreference
Obviously, you would have to provide a UI for the user to view the list of sort options. The list would contain radio buttons for each option, and the default (or current) ...
Get Pro Android 4 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.