16.02.2011 16:53, Mattias Svala пишет:
OK. I was exploring TreKing's initial suggestion. If I interpreted him correctly than I should be able to use a Preference instance, without subclassing it,
Why not, if you'd like to avoid subclassing.
and setting the on click handler on it to launch some activity and then handle the result of that activity in my PreferenceActivity. Handling the result would mean to me that I need to set that value in the Preference instance that was clicked. Perhaps that is not possible?
The base class, Preference, provides convenience methods ("persistXXX") but you won't be able to use them without subclassing, since they are protected.
Preference values are ultimately stored using the regular shared preferences mechanism, which is entirely accessible to your application code.
If you're not subclassing, store the value the usual way, but you will probably need to get the preference editor using Preference.getEditor so it's the same one as used by PreferenceActivity where your preference is (depending on when exactly you will be storing the value).
Which would suggest that I need to sublclass Preference in order to create a contact picking preference.
I'd implement a self-contained Preference subclass, but maybe that's just me.
-- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

