I want to schedule a notification everytime the user add a note in the database for a specific time. While there are multiple ways to do it using AlarmManager, BroadcastRece
According to the Android official documentation about worker manager: "These APIs let you create a task and hand it off to WorkManager to run immediately or at an appropriate time". In my app, I set a work to be activated 20 seconds after:
// Schedule the time
val request= OneTimeWorkRequestBuilder().setInitialDelay(20, TimeUnit.SECONDS).build()
WorkManager.getInstance().enqueue(request)