android_guides icon indicating copy to clipboard operation
android_guides copied to clipboard

How can I combine AlarmManager with sync adapter?

Open zoezhou1999 opened this issue 6 years ago • 0 comments

I have read this in the document and guide, but I don't know how to use it. Can someone help me?

Notice that addPeriodicSync() doesn't run the sync adapter at a particular time of day. To run your sync adapter at roughly the same time every day, use a repeating alarm as a trigger. Repeating alarms are described in more detail in the reference documentation for AlarmManager. If you use the method setInexactRepeating() to set time-of-day triggers that have some variation, you should still randomize the start time to ensure that sync adapter runs from different devices are staggered.

zoezhou1999 avatar Feb 21 '19 04:02 zoezhou1999