I have been roaming in forums for days and all I found was same repeated responses which don't work at all. I am trying to set an alarm for a certain time (e.g. 8PM) to send a notification. However, as soon as I force close the app the alarm is also cleared. It works fine if app is running in the foreground or minimized. Peopled asked this in many other questions and received same questions that none of them work. I brought some of them in the following:
- use service(sticky or other types)
- use flag FLAG_INCLUDE_STOPPED_PACKAGES for the intent
- start service again in onDestroy or onTaskRemoved some other responses none of which seems to work. Do you know any best practice to set some alarms to send a notification at a certain time? it seems like this problems happens in some devices with restrictions like MIUIs. Thanks in advance for your responses.