>>>>> "Jake" == Jake Colman <[email protected]> writes:
Jake> I am looking to implemented widget-specific preferences in my Jake> app. I have reviewed numerous blogs and posts, including Jake> Kostya's, and am familiar with the overall approach of using Jake> the widget ID as a suffix to the preference key. Jake> I currently use a Preference Activity and a preference XML file Jake> to manage my preferences. Since a Preference Activity handles Jake> edits on its own, is there still a way to use it if I need to Jake> change the key name at runtime to have a widget id? I am Jake> pretty sure I can get the widget from the intent since it is Jake> launched as a configuration activity but can I tap in and use Jake> it? I'd like to continue this old thread. I have not been able to devote enough concentrated time to this but I am finally just about there. I am now able to support widget-specific preferences and the widget's honor their widget-specific value. The problem now is that when I redisplay my Preference Activity the screen does not display the correct values for booleans. It looks to me like the Preference Activity is being instantiated with the default values from the generic keys. How can I force the screen to get its values from the widget-specific keys? To provide some background on what I have already done, in my Preference Activity onCreate() method I use findPreference() to reset each preference's generic key to have the widget-specific key value. Anywhere in my code that I need to retrieve a preference value, I construct the widget-specific key name and get the data. All this is working correctly. The only issue is when I launch the Preference Activity from the widget it does not display the widget-specific value but displays the preference's default value. Any ideas? Do I need to derive from Preference Screen so that I can get access to the protected 'get' methods that access persisted values from the SharedPreferences? -- Jake Colman -- Android Tinkerer -- 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

