Hi all,

Differently from most application, the state of my application is not
controlled by its stack of activities but by the state of a background
service.

Here is my problem. Suppose I have a task running  with  a non empty
stack of activities. The top activity is paused on background and not
visible.  Then for some reason the  process that host both the service
and top activity is killed.  When I somehow return to my app
application ( by pressing back key, resumimg from recent apps menu),
the framework launches  the application again with the activity that
was on the top of the activity stack  before process got killed.

Okay, you would say that it is the expected behavior. But because my
service is no longer alive , the top activity is no longer valid ( as
the other activities which remain  on stack) . I would like to clear
the whole activity stack  and launch another activity to explain the
current situation to user.

I could put the follow code on every activity "if(not valid state)
finish() and launch a new activity with clear top flag  enabled " but
I don't think it is clever.  Is there a better way to control which
activity will be launched after application is killed ?


Tks,
André

-- 
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