Sunday, July 4, 2010

Re: [android-developers] Re: PreferenceActivity and appWidgetId relation

If you allow the user to configure individual widgets, then you need to
store settings separately for each widgetId.

I recently implemented this for my widgets, here is how:

http://kmansoft.wordpress.com/2010/06/22/per-widget-options-stale-widgets/

-- Kostya

04.07.2010 21:22, Premier пишет:
> I want to know how i can get shared preferences for each appWidgetId.
>
> Regards.
>
> On 4 Lug, 18:56, Premier<a.grum...@gmail.com> wrote:
>
>> Hello,
>> i'm using PreferenceActivity class to configure my widget.
>> PreferenceActivity class automatically saves user preferences, so in
>> widget update service i can call context.getSharedPreferences() and i
>> obtain user preferences.
>>
>> Problem is follow: if you have many widget of same type, how
>> PreferenceActivity class saves prefs? how i can load appWidgetId
>> specific prefs from sharedPreferences?
>>
>> Thanks.
>>
>


--
Kostya Vasilev -- WiFi Manager + pretty widget -- 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment