开发者

List Preference and Shared Preferences

When and How do you use the ListPreferences? Is it an alternate for ListActivity, li开发者_如何学CstView?

How do you decide whether this is the better choice?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜