I am setting AlarmManager
for scheduling local notification. I have tried many different solution like this, but all in vain.
That answer suggest me to use setExact()
and setExactAndAllowWhileIdle()
methods for different version of apis code sample below:
if (Build.VERSION.SDK_INT >= 23) {
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP,
triggerTime, intent);
} else if (Build.VERSION.SDK_INT >= 19) {
alarmManager.setExact(AlarmManager.RTC_WAKEUP, triggerTime, intent);
} else {
alarmManager.set(AlarmManager.RTC_WAKEUP, triggerTime, intent);
}
I am checking the device alarm with command adb shell dumpsys alarm
. Alarms are there, but not triggering.
Batch{365d942c num=2 start=132037642 end=132037642}:
RTC_WAKEUP #1: Alarm{2f05aef5 type 0 when 1506076080000 com.mominapp.mominapp PRAYER_TIME_NOTIFICATION_ACTION}
tag=*walarm*:PRAYER_TIME_NOTIFICATION_ACTION
type=0 whenElapsed=+35m18s677ms when=2017-09-22 15:28:00
window=0 repeatInterval=0 count=0
operation=PendingIntent{738548a: PendingIntentRecord{297a3afb com.mominapp.mominapp broadcastIntent}}
This shows that my application has an alarm scheduled at 15:28 but it is not triggered by any mean. I am facing this problem specially for OPPO and Samsung Devices.
Any help will be appreciated. Kind Regards.