I also met the same issue. I have an UI app with a service running at
background.
When the app is forced stop, the service could not be restarted to
correct state
without appropriate cleanup before stopping.

I understand that Android forced stop should have power to kill my app
and service
directly, but at least give apps some opportunity to do cleanup, such
as sending a
notice intent. Otherwise, user has to restart the phone to use some
app if he does
force stop before.

---
Chris

On Oct 3, 6:34 am, emylyano3 <emylya...@gmail.com> wrote:
> Hello Dianne,
>
> Ok, I understand your point, but this Android feature is giving me a
> headache. Instead of solve this issue (force stop) , lets change the
> conversation angle.
> I have an app (App1) that controls the excecution of another one
> (App2). The problem that I have is that the app1 decides how many time
> the app2 can be run.
> The execution steps are the following:
> Launches the app1 and the user selects from a menu to launch app2
> (app2 is launched from app1). The thing is that app2 should run just
> for a few seconds.
>
> If the user accesses to the application manager and makes a force stop
> of app1, he will be able to run app2 as many as he wants. I need to
> know when this happens (app1 is being killed) to kill app2 too, BUT
> the problem here is that I cant change the code of app2. So, how can I
> resolve this??
>
> Thanks in advance!!
>
> Emy
>
> On Oct 2, 5:37 pm, Dianne Hackborn <hack...@android.com> wrote:
>
>
>
> > 2009/10/2 José Prieto Garay <jose.prietoga...@gmail.com>
>
> > > I think this is the point, normally when our application needs to be
> > > destroyed in order to release memory, or it's in a lower priority then
> > > onDestroy() is called.
>
> > That is not true.  If the user presses home, they will leave your app, it
> > will go in the background, and onDestroy() will not be called.  If you have
> > left a service running, it is still in the background, and it is running,
> > onDestroy() has not been called, but the system could very well kill it
> > anyway when under memory pressure (which you will see a lot on devices like
> > the G1 or myTouch).
>
> > > With this "Force Stop" stuff not, there isn't any way to be aware
> > > about our threads and tasks to be killed.
>
> > So how is this any different from a user going to the windows task manager
> > and force killing an app?  Or your application crashing while it is
> > running?  Or it ANRing and the user deciding to kill it?  Or the user
> > pulling the battery from their device?  Or a desktop machine losing power?
> > I don't think any of these things should leave an application in a bad state
> > it can't recover from.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to