How inexact is setInexactRepeating() for AlarmManager?

后端 未结 1 573
失恋的感觉
失恋的感觉 2020-12-10 12:26

So here\'s the deal... I\'ve got to silence the user\'s phone when they have class. So I need an alarm to go off daily at a specific time, for each class.

So I\'m t

1条回答
  •  囚心锁ツ
    2020-12-10 12:48

    Probably not, especially if that's an interval of an entire day.

    From the documentation:

    Your alarm's first trigger will not be before the requested time, but it might not occur for almost a full interval after that time. In addition, while the overall period of the repeating alarm will be as requested, the time between any two successive firings of the alarm may vary. If your application demands very low jitter, use setRepeating(int, long, long, PendingIntent) instead.

    0 讨论(0)
提交回复
热议问题