Android:AlarmManager - 重复日期设置为过去 - 未来的警报会触发吗?

Android: AlarmManager - Repeating Date set to past - Will future alarms trigger?

如果我设置方法的"triggerAtMillis" setRepeating(int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) 到过去的日期,未来的警报会触发吗?

这完全取决于您指定的类型

这是类型列表:

ELAPSED_REALTIME — Fires the pending intent based on the amount of time since the device was booted, but doesn't wake up the device. The elapsed time includes any time during which the device was asleep.

ELAPSED_REALTIME_WAKEUP — Wakes up the device and fires the pending intent after the specified length of time has elapsed since device boot.

RTC — Fires the pending intent at the specified time but does not wake up the device.

RTC_WAKEUP — Wakes up the device to fire the pending intent at the specified time.

所以答案是肯定的,它会花费那么多时间间隔,并且根据类型在未来重复出现。

查看documentation了解更多