setExactAndAllowWhileIdle - is not exact as of developer reference

后端 未结 5 1632
面向向阳花
面向向阳花 2020-11-29 00:40

AlarmManager on API19 has the method setExact() to set an exact alarm.

Exact means --> If I set an alarm to 2:01 p

5条回答
  •  被撕碎了的回忆
    2020-11-29 01:08

    I have found that so far the best option is to use a SyncAdapter that extends AbstractThreadedSyncAdapter. I schedule it to automatically keep running my code at the required interval:

    ContentResolver.setSyncAutomatically(account, AUTHORITY, true);
    ContentResolver.addPeriodicSync(account, AUTHORITY, settingsBundle, syncInterval);
    

提交回复
热议问题