I am working on a task scheduling app that reminds me of a task at a certain time. I used to implement this with getSystemService(AlarmManager.class).set(RTC_WAKEUP, millis, pendingIntent);
. Then a IntentService
gets started later and shows a notification.
But in Android Oreo my IntentService
simply doesn't get called at all. I noticed the massive discussion about the Background Execution Limits and how you should migrate from AlarmManager
to JobScheduler
, but nobody mentions how JobScheduler
can start a job based on RTC.
What my IntentService
does besides showing a notification is nothing more than setting the task as "notified" or "done", which I think is incomparable to the heavy tasks like synchronizing big amount of data over network that the JobScheduler
was introduced for.
What is the best practice in Android Oreo to implement time-based notifications?