I have a question with the onUpdate function of an android appwidget: I am updating the appwidget once a day with that function. Before this I used a TimerTask class to update the widget but Android sometime closes that TimerTask and my widget stops updating. If I use the onUpdate function the oS will do the same as before or it will work good?
this is the xml that provides the updates:
<?xml version="1.0" encoding="utf-8" ?>
<appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="262dp"
android:minHeight="244dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/main"/>
If your question was “will Android call my widget’s onUpdate() method every 86400000 millies?” then the answer is “yes, it will”. And it will do so for every instance of your widget independently (how did you manage the widget ID in your service?).