O'Reilly logo

Pro Android 4 by Satya Komatineni, Dave MacLean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Organizing Preferences

The preferences framework provides some support for you to organize your preferences into categories. If you have a lot of preferences, for example, you can build a view that shows high-level categories of preferences. Users could then drill down into each category to view and manage preferences specific to that group.

Using PreferenceCategory

You can implement something like this in one of two ways. You can introduce nested PreferenceScreen elements within the root PreferenceScreen, or you can use PreferenceCategory elements to get a similar result. Figure 13–5 and Listing 13–8 show how to implement the first technique, grouping preferences by using nested PreferenceScreen elements.

The view on the left in Figure 13–5 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required