On May 28, 2:16 am, guich <[email protected]> wrote:

> When the alarm is dismissed, my app receive the events onClose and
> onDestroy.

Any time your activity isn't in the foreground, it may be removed from
the stack if the system thinks it needs the resources. This is a
normal part of the activity lifecycle, and I doubt that Alarm Clock is
doing anything different than any other app which might take the
foreground focus away from yours.

> I already saw other apps that survive after the alarm is triggered.

If their activities use fewer resources than yours - or if the system
has more free at the time - they may be less likely to be destroyed.
But the lesson is that you need to save state whenever your activity
loses focus, because there's no guarantee that focus will return
anytime soon.

String

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to