我的任务是,在Android设备中发生事件之前/之后发送通知。我尝试使用AlarmManager,Worker,JobScheduler,但是当用户杀死我的应用程序时,这些后台任务都无法正常工作。有没有一种方法可以在Android中完成此简单任务?
thx扎梅克
即使应用程序退出,也应使用WorkManager来确保执行。
WorkManager
Introduction to work manager
Official documentation
Useful Codelab to grasp the concept