Jake,

You can get a list of widget ids by doing something like:

AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
        ComponentName provider = new ComponentName(context, Widget.class);
        int[] widgets = appWidgetManager.getAppWidgetIds(provider);

This widget id list need to be filtered for "stale" ones.

-- Kostya

03.05.2011 23:58, Jake Colman пишет:
Kostya,

Gee, I hope I'm not revealing my ignorance here...

I build my RemoteViews in an IntentService.  I suppose I have to find a
way to pass the widgetid into the Intent that is used to start the
service.  If the service knows the widgetid, it can putExtra that
widgetid into the Intent used to start the Preference Activity.

So now the question is how to get widgetid ID from the AppWidgetProvider
to the IntentService.  onUpdate() is passed the appWidgetIds that need
to be updated.  I, however, do not use that method for anything.
Instead, I use alarms to trigger my updates since I am updating every 60
seconds in one instance or every 24 hours in another.  Currently my
alarms send an Intent that is processed by the AppWidgetProvider's
onReceive() method.  That method does not get a widgetid.  Any idea how
I can get the set of widgetids to be updated if Android has no passed it
to me in onUpdate?

...Jake


--
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 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