Alarm manager does not work on OPPO handsets if the application is closed from recent applications. I am rescheduling a service after certain interval using alarm manager with help of following source code.
if (Build.VERSION.SDK_INT >= 23) {
alarm.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,
interval *
SystemClock.elapsedRealtime() +
60 * 1000 , pending);
} else if (Build.VERSION.SDK_INT >= 19) {
alarm.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, interval *
SystemClock.elapsedRealtime() +
60 * 1000, pending);
} else {
alarm.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, interval *
SystemClock.elapsedRealtime() +
60 * 1000, pending);
}
This source code is working on Nexus devices, Moto devices, Samsung devices, Xiomi devices and one plus devices.
Let me know, Anyone who got the working solution with OPPO devices using Alarm manager.