Android Widget Update After X Time
I just started to learn Android, I'm trying to write a widget which is updating the counter in every seconds, but somewhere it's missing something.I'm getting 1 on the screen. I'm
Solution 1:
Here is a great tutorial series for creating widgets in Android and updating them at intervals. It starts here: http://android-er.blogspot.com/2010/10/simple-home-screen-app-widget-with.html
And ends here with a recurring timer/alarm: http://android-er.blogspot.com/2010/10/app-widget-using-alarm-manager.html
Basically you need to setup some things in the manifest to listen for a broadcasted intent which updates the widget. It also shows how to create a config activity for the widget.
To create alarms or recurring events you can also use the AlarmManager class.
Solution 2:
after
appWidgetManager.updateAppWidget(appWidgetId, views);
add this
super.onUpdate(context, appWidgetManager, appWidgetId);
i believe this will solve your problem
Post a Comment for "Android Widget Update After X Time"