My widget is simply a Date Widget. What I need is to update the UI at 12:00 am each day (After midnight). This is how I did it at the first time:
In my widget_info.xml:
android:updatePeriodMillis="1000*60*30" //equals to 30 min which is the min time you can update.
This method works fine except for one thing: it didn’t update at the 12:00 am exactly. It may update in the range 12:00-12:30 am (In my case it updates at 12:19 am). How can I force an update when each hour begins?
I read something about using AlarmManager which will help you update the widget in less than 30 min. This will solve my problem (if I force it to update each minute) but can I have a simpler solution than that?
You will have to go the
AlarmManagerroute if you need precise update times…