How to notify Android Widget to redraw -


i have android widget using remoteviewsfactory in order populate listview.

my data source asynchronous json call can done @ time (it's not push notification). right code located in ondatachanged , looks this:

@override public void ondatasetchanged() {      // subsequent calls data.     // called when widget onreceive action_appwidget_update procs.     newsgetter.updatelistfeed(null, new newsgetter.onupdatelistfeedfinishedlistener() {         @override         public void onupdatelistfeedfinished(volleyerror error) {             //called when async call has finished. not sure call here?         }     });      log.e(tag, "******************************** ondatasetchanged provider"); } 

every hour (i've set updateperiodmillis update every hour) appwidgetprovider gets onreceive call asking update (action_appwidget_update) , such above code runs. however, after code runs , updates feeditems, ui never updates when scrolling.

so question is: how invalidate ui , tell redraw views?

so far i've tried:

appwidgetmanager.notifyappwidgetviewdatachanged(appwidgetid, r.id.widget_list); 

but calls ondatachanged cause infinite loop, can't use that.

the solution issue use localbroadcastmanager send message remoteviewsfactory appwidgetprovider. example, see here: android onreceive not called


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -