java - AppWidget refresh 12 times -
i have code:
int = 0; while(true){ i++; remoteviews.settextviewtext(r.id.textview1, "" + ); appwidgetmanager.updateappwidget(thiswidget, remoteviews); try { thread.sleep(1000); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); }
this code refresh widget, 12 times. when "i" reaches 12 nothing happens. how fix it?
appwidgetprovider class extends broadcastreciever , , not correct have while(true) loop in reciever class.
if want refresh widget @ interval of every 1 second provide information in android:updateperiodmillis="1000" in app widget xml file placed @ res/xml/ folder in project.
thanks! bhushan
Comments
Post a Comment