我是使用AlarmManager
PendingIntent pendingIntent = PendingIntent.getService(FleetRefreshNotiService.this, 1, givenIntent, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager.AlarmClockInfo clockInfo = new AlarmManager.AlarmClockInfo(timeWillbe, pendingIntent);
mAlarmManager.setAlarmClock(clockInfo, pendingIntent);
,我正在使用我的应用程序。和塔瑟(https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm)
由adb shell dumpsys alarm
签出
批处理{2df386 num = 1开始= 598017988结束= 598017988 flgs = 0x3}: RTC_WAKEUP#0:警报{367b447,当1551056248419 jc01rho.ogame.alarm.ognotifier.debug时输入0) tag = 警报:com.myapp.debug / com.myappNotiService 类型= 0 whenElapsed = + 1m24s525ms when = 2019-02-25 09:57:28 窗口= 0 repeatInterval = 0计数= 0标志= 0x3 闹钟: triggerTime = 2019-02-25 09:57:28 showIntent = PendingIntent {1ff9474:PendingIntentRecord {c8fe766 com.myapp.debug startForegroundService}} operation = PendingIntent {ec5bd9d:PendingIntentRecord {c8fe766 com.myapp.debug startForegroundService}}
在“禁用Tasker”之后丢失了
对于“禁用Tasker”,我该怎么办?
答案 0 :(得分:0)
我找到了答案,离开的人与我面临同样的问题。
AlarmManager.AlarmClockInfo clockInfo = new AlarmManager.AlarmClockInfo(timeWillbe, pendingIntent);
错了。
请在AlarmClockInfo的PendingIntent参数中设置null。
修复
AlarmManager.AlarmClockInfo clockInfo = new AlarmManager.AlarmClockInfo(timeWillbe, null);
很抱歉,我不知道原因。请有人更新此原因。
thx。