I'd like to re-open the discussion for keeping apps open when they are not in the foreground! Here's my specific usage:
I created a workout-timer app with my friend Will, it's had a bit of success (downloads in the thousands for the free version! And... 30-ish purchases for the Pro version).
Anyway, let's say you're working out and using the timer to track your progress. You MUST have the app in the foreground with the screen ON the entire time you're working out, or it will pause. What if you're timing your run/jog and want to put the app in your pocket? You can't leave the screen on or the contact with your leg will stop the timer! What if you leave the screen on, but get a phone call while the timer is running? You can ignore the call, but because the Phone app takes precedence in the foreground, the timer will stop running!
Now, to keep an app running in the background, or while the screen is off, I believe you must use a notification that cannot be cancelled (this is at least true for devices with low memory). So this brings into discussion custom notifications! In my app, I would like to show the user the current time of their timer in the notification. That way, if for example you're using the timer as an egg timer, you can switch to your recipe app, and pull down your notification bar to see how much time is left on your timer!
Along with these features, we would need a way to find out if our app has left the foreground (so I can activate the notification) or is back in the foreground (deactivate the notification). I propose a condition in the Android extension that states "App has left foreground" and "App has returned from background," or a negateable "App is currently in foreground" that we can use for this purpose.
I really hope these features get implemented, they would be extremely helpful to all of us!!