If you lookt at here (http://github.com/commonsguy/cw-advandroid/blob/
master/AppWidget/TwitterWidget/src/com/commonsware/android/appwidget/
TwitterWidget.java) Mark Murphy use PreferenceActivity to store widget
preferences, and after it uses
prefs=PreferenceManager.getDefaultSharedPreferences(this); to retrieve
preferences.
In my app, it doesn't works.

On 4 Lug, 20:04, Kostya Vasilyev <kmans...@gmail.com> wrote:
> 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-wid...
>
> -- 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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to