My application widget works in several modes. For each of these modes, I created RemoteViewsFactory . To switch between modes, I send the intent to my AppWidgetProvider . Having received it, I create RemoteViews and pass it to AppWidgetManager updateAppWidget() . To set RemoteViewsFactory to represent the collection, I call RemoteViews ' setRemoteAdapter() :
rv.setRemoteAdapter(appWidgetId, R.id.widget_view_flipper, intent);
R.id.widget_view_flipper is a collection view, intent for RemoteViewsService to build the corresponding factory.
EDIT: I edited this question because I found out the originally described problem. Now, when I change the factories, the getViewAt() new factory is called after the change, but the item in the collection view is simply not updated! How will this happen?
Currently, the only thing I came up with is that I can call AppWidgetManager notifyAppWidgetViewDataChanged with a delay after replacing the factory, this causes the item in the view to update with an ugly blink.
source share