我遇到一个非常简单的应用程序的问题,该应用程序每天都会显示一次通知。要做到这一点,我只是这样做:
PendingIntent pendingIntent = [pending Intent to a Service]
alarmManager.setInexactRepeating(AlarmManager.RTC, DateTimeUtil.getTomorrowAtEight(), AlarmManager.INTERVAL_DAY, pendingIntent);
这可以在运行Android 6.0(LG G4)的设备上运行几天然后停止工作。
adb -d shell dumpsys alarm
表明我的警报确实不在"等待警报批次列表中#34;。
我在运行Android 5.1(Samsung S4)的设备上没有遇到此问题。
我猜测这与打盹模式或App Stand by有关,但据我所知(如果我错了,请纠正我),警报可以延迟,这对于我的用例,但不应该被取消!
想法?