Skip to content Skip to sidebar Skip to footer

Individual Preferences For Each Item In A Listview?

I'm creating my first android app (or attempting to anyway) and i have a question i can't seem to find the answer to. I would like to allow users to enter a separate set of prefere

Solution 1:

Solved it!!

For any wondering, the solution is that you must call

getPreferenceManager().setSharedPreferenceName(value) with a value unique to the item you'd like to modify the preferences for (in my case, i used the ListView position) prior to calling addPreferencesFromResource.

Solution 2:

getPreferenceManager() deprecated on api 11

Now with honeycom and ICS the method getPreferenceManager() is deprecated. Do you know how to do that with the new (PreferenceFragment + Headers)?

Thanks men! It works perfect in earlier versions!

UPDATE: Up to api level 11 is the same method but you have to call it on a Fragment, not on activity.

Post a Comment for "Individual Preferences For Each Item In A Listview?"