On Tue, Sep 7, 2010 at 6:30 PM, Eric <[email protected]> wrote:
> I am trying to update an AppWidget manually when a user setting
> changes on the device. To do so I use code similar to this:
>
> ComponentName thisWidget = new ComponentName(this, MyAppWidget.class);
> AppWidgetManager manager = AppWidgetManager.getInstance(this);
> manager.updateAppWidget(thisWidget, updateViews);
>
> I can tell that my AppWidget onUpdate method is being called as a
> result since I log some debug strings to logcat in the code. However
> the AppWidget itself doesn't change on the screen.
>
> Here comes the interesting part: if I rotate my device and force a
> refresh of the home screen (from PORTRAIT to LANDSCAPE or vice-versa)
> then finally my AppWidget gets updated. However rotating the device
> does not trigger the onUpdate method to be called, so the AppWidget
> must be using the RemoteViews provided in the earlier update.
>
> Can somebody explain me what to do to force the home screen redraw of
> my AppWidget when it processes an update????

The process you are using should work fine. I have used that technique
for things like refresh buttons on app widgets without incident.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

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

Reply via email to