How to schedule notification for a specific date and time in android studio?
I want to set notification for a specific date and time (ex: 15/7/2018 02:00:00) in Android.
Can anyone help me?
Actually, it's not a duplicated question since the Android background and scheduling management changed dramatically on the newer versions; it's not really good practice to use
also, you are not able in most cases.
I recommend using
WorkManagerfrom the recent jet pack project. take a look at Schedule tasks with WorkManager
WorkManager might use JobScheduler, Firebase JobDispatcher, or AlarmManager. You don't need to write device logic to figure out what capabilities the device has and choose an appropriate API; instead, you can just hand your task off to WorkManager and let it choose the best option.