I similarly posted this question on to StackOverflow:
http://stackoverflow.com/questions/6837032

I am developing an appwidget that uses the RemoteViews to display a
ListView. For simplicity's sake, I will give an analogy of the
appwidget's functionality:

1. The user will select to add the appwidget to the home screen. Upon
selecting the widget, a configuration activity is launched and the
user selects from one recipe from a list of recipes.

2. Upon selecting the recipe from the configuration activity, the
configuration activity broadcasts the
AppWidgetManager.ACTION_APPWIDGET_UPDATE intent. This intent received
and handled in the onReceive method of my AppWidgetProvider class.
>From here the RemoteView is instantiated and passed into the
AppWidgetManager.updateAppWidget() method. This proceeds to fill in
the ListView of ingredients.

This all works as expected, except when I attempt to manually update
the ListView from the appwidget. I have set a PendingIntent to re-
launch the configuration activity, which also works. Unfortunately,
the call to AppWidgetManager.updateAppWidget() does not get called
instantly as it did when being launched upon adding it to the home
screen and the ListView does not get updated.

The update does get called, however, after scrolling down the list a
ways (until it gets passed the number of rows it has loaded in its
cache, I reckon). This fires off my FlightBoardAppWidgetService and
ViewsFactory as it should. It is almost as if the updateAppWidget is
getting put into some lazily-loaded queue. I tried to look at the
Android source code to see how AppWidgetManager.updateAppWidget() is
coded, but it appears to be hidden.

tl;dr: AppWidgetManager.updateAppWidget() does not always get called
instantly, what gives?

Is there any way to get the ListView to update when it is actually
called? What am I doing wrong? Thanks!

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