Why is the broadcast AlarmManager canceled when the application is killed?

So, I have two BroadcastReceiver registered. When the application is closed, they both shoot at the appropriate time and perform the appropriate actions.

If the application is closed, then it was killed (say, using AppKiller), the receivers never receive their transmissions, and nothing happens.

Presumably, the same thing happens if the parent application is killed due to low memory, so how can I ensure that these broadcasts are started / received. The API claims that even if the application is killed, it should work, does anyone else have experience in this situation?

If this helps my manifest:

<!-- receivers for AlarmManager --> <receiver android:exported="true" android:label="Shift roster updating calendar." android:name="com.skooter.shiftroster.backend.service.UpdateCalendar" > </receiver> <receiver android:exported="true" android:label="Shift roster checking alarm." android:name="com.skooter.shiftroster.backend.service.SetWakeup" > </receiver> 

and nothing esoteric happens in AlarmManager / BroadcastReceivers

+4
source share
1 answer

Presumably, the same thing happens if the parent application is killed due to low memory

You are wrong. The so-called "task killers" use a specific API that is not used in low memory conditions. The task killer API runs everything, including scheduled alarms.

Also, your parent application, hopefully not in the first place. The whole point of using AlarmManager is that your “parent application” does not take up memory when it does nothing.

0
source

Source: https://habr.com/ru/post/1309865/


All Articles