5

A great example of the kind of Activity I'm trying to create is the gmail app settings Activity. It lists all the customizable settings vertically with horizontal rules between each setting. There are variety of fields that usually look identical. For example: text fields usually display a bold heading with a description below and a circled triangle to the right.

What kind of viewgroup is the root view? What kind of view or viewgroup is each field?

objectivesea
  • 597
  • 1
  • 6
  • 22

1 Answers1

16

A settings Activity will usually be derived from PreferenceActivity. Take a look at the link and see if that's what you're looking for.

Harry Joy
  • 58,650
  • 30
  • 162
  • 207
jjb
  • 3,560
  • 1
  • 21
  • 30
  • That's a perfect answer to my question; however, I'm not ACTUALLY creating a preference activity. It's just an activity with many fields for user input. I want to use a preference-like layout rather than directly embed objects like Button and EditText in the activity. Instead, I'd like to put selectable items (like in a preferenceActivity) that display dialogs for each field when selected. – objectivesea Jan 12 '11 at 23:45
  • The individual items on a PreferenceScreen have onPreferenceTreeClick that will tell you which screen (group of preferences, basically) was clicked and which specific preference. You could probably use that to do whatever you wanted. It's a little odd, but it might work, particularly if you build the PreferenceScreen you want programmatically. I haven't looked closely, but you might be able to grab the styles from the SDK that PreferenceActivity/PreferenceScreen uses and pull those into your app as well. – jjb Jan 13 '11 at 05:37