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 preferences for each item in a list view. I have the PreferenceScreen working, but it maintains the same preferences for every item (i.e. changing 1 item results in changes to all others as well).
To give a more detailed example:
Say i have a list of cars:
* Car 1
* Car 2
* Etc…
I would like to be able to click on “Car 1” and get a PreferencesScreen to specify “Make”, “Model”, “Color” for just that car, instead of having those entries stored globally for the whole app.
Is this possible?
Thanks for your help!
//N
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 theListViewposition) prior to callingaddPreferencesFromResource.