ClouddJR / arkadiuszchmura.com

Repository for my personal blog
https://arkadiuszchmura.com
1 stars 0 forks source link

posts/how-to-reliably-update-widgets-on-android/ #3

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

How to reliably update widgets on Android | Arkadiusz Chmura

The default solution with android:updatePeriodMillis doesn’t always work.

https://arkadiuszchmura.com/posts/how-to-reliably-update-widgets-on-android/

f23505106 commented 1 year ago

when use WorkManager, what the value updatePeriodMillis is set? thanks

ClouddJR commented 1 year ago

I think it doesn't really matter, since you would mainly depend on the WorkManager to do the updates for you. However, just to be sure, you could specify the android:updatePeriodMillis value depending on your needs (but keep in mind that the minumum interval time is 30 min).

f23505106 commented 1 year ago

thanks, I see your, if updatePeriodMillis is 30 min, WorkManager 30min period too, then the onupdate will be called twice in 30 min, meanwhile the onupdate called period is unpredictable,maybe 15min or 10+20min, of course updatePeriodMillis can be set to 0, then onupdate will be called only from WorkManager, as your reply depending on needs, just curious about your practice.