title: When does my app's process die
body: <p>I have an alarm application where users can set multiple alarms. When an alarm goes off (using AlarmManager and a BroadcastReceiver) the app simply displays a Notification.</p>
  
  <p>My app may not be in the foreground for long periods of time so there will be no UI thread running.</p>
  
  <p>My question is, when an alarm goes off and a Notification is displayed, part of my app's code is executed (the BroadcastReceiver and Notification creation). What happens next? Is my app's process immediately killed? Does it remain in some idle state until Android decides to kill it?</p>
  
  <p>(This is all related to another question (http://stackoverflow.com/questions/11376294/do-i-need-to-persist-my-notification-ids) about persisting Notification IDs. When my app is not running in the foreground and two alarms go off a minute apart, I store the Notification IDs in a static ArrayList. Using the debugger on the second Notification creation it seems that my Notification creator class still holds the first Notification's ID in the ArrayList. This suggests that the process lives between the first and second alarm going off.)</p>