0

how can I configure a preference activity to automatically show preference headers on the left and the details of the selected header on the right? Can you point me to some docs? Thanks in advance!

Gianni Costanzi
  • 6,054
  • 11
  • 48
  • 74
  • 1
    This happens automatically with `PreferenceActivity`, running in Android 3.0+, on a large screen device (e.g., tablet). – CommonsWare May 12 '12 at 21:46

1 Answers1

1

From the documentation,

This activity shows one or more headers of preferences, each of which is associated with a PreferenceFragment to display the preferences of that header. The actual layout and display of these associations can however vary; currently there are two major approaches it may take:

On a small screen it may display only the headers as a single list when first launched. Selecting one of the header items will re-launch the activity with it only showing the PreferenceFragment of that header. On a large screen in may display both the headers and current PreferenceFragment together as panes. Selecting a header item switches to showing the correct PreferenceFragment for that item.

Thus, the behavior you are describing is automatically supported on large screen tablets running Android 3.0+.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
  • Oh, I've misunderstood that part of the documentation... when I've read *it may display both the headers and current etc..* I thought that it was an option and I was wondering how to specify it... Sorry for the stupid question! – Gianni Costanzi May 13 '12 at 09:03