android - Why Isn't My Textview Setting Text In Widget -
i'm noob android , i'm trying loop text in 2 textviews in widget text arraylist. reason, widget showing first text values arraylist , not looping subsequent values. i'm sure arraylist has multiple values that's no problem. help appreciated.
my code;
void updatestory() { tickerheadline = rssreader.rssheadline.get(storycounter); tickerstory = rssreader.rssstory.get(storycounter); remoteviews.settextviewtext(r.id.headline, tickerheadline ); remoteviews.settextviewtext(r.id.story, tickerstory ); if (storycounter==rssreader.rssheadline.size()-1){ storycounter = 0; }else{ storycounter++; } appwidgetmanager.updateappwidget(r.layout.widget1, remoteviews); mhandler.postdelayed(new runnable() { public void run() { updatestory(); } } ,5000); } }
you need update widget through appwidgetmanager after each change.
appwidgetmanager appwidgetmanager = appwidgetmanager.getinstance(context); appwidgetmanager.updateappwidget(appwidgetid, remoteviews);
android loops widget textview handler
No comments:
Post a Comment