views:

53

answers:

1

Ok so I have two BroadcastReceiver registered. When the app is closed they both fire at the appropriate times and do the appropriate things.

If the app is closed then killed (say with an AppKiller), the receivers never receive their broadcasts, and nothing happens.

Presumably the same thing happens if the parent app is killed due to low memory, so how do I ensure those broadcasts are fired/received. The API states that even if the app is killed it should fire, does anyone else have experience with this situation?

If it helps my manifest is:

<!-- 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 is going on in the AlarmManager/BroadcastReceivers

A: 

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

You presume incorrectly. So-called "task killers" are exploiting a particular API, one that is not used in low-memory conditions. The "task killer" API nukes everything, including scheduled alarms.

Moreover, your parent app hopefully isn't in memory in the first place. The whole point of using AlarmManager is so your "parent app" is not around taking up memory when it is not doing anything.

CommonsWare
Thanks.The parent app is put into the background and available to be closed by system; thats kind of the point of the app to just keep the alarms running
skooter