Namratha
Namratha

Reputation: 16780

List Preference and Shared Preferences

When and How do you use the ListPreferences? Is it an alternate for ListActivity, listView?

How do you decide whether this is the better choice?

Upvotes: 2

Views: 1350

Answers (1)

Pentium10
Pentium10

Reputation: 207838

As it's name says List Preferences are used to store Preferences. I use for example to choose the car color of my buddies. This will be saved to shared preferences.

List Preference needs to go in a PreferenceActivity, so that should only be Settings, that's how is advised. A ListPreference is a 1 row display in Preference Activity and will open up the choices to select from.

ListViews are used for much more, and is intended for all use except settings/preferences. If you want your users to navigate on the list and choose one and see some screen coming up on that info you need ListView.

Upvotes: 5

Related Questions