If you have called startService() for your service, then you are
saying you want it to run until it is stopped.  So if you kill your
process, it will be restarted to continue running the service.

Also, when a process running the foreground activities is killed, then
that activity will be removed and the next one on the stack started.
If the next one on the stack is run by the same process that was
killed, then a new process will be started to run it.

Please keep in mind the way process management works on Android: a
process is just a container to run whatever the user wants to be
doing.  Processes being killed is a normal part of the operation of
the system, and happens all of the time to things in the background.
As such, the system will automatically start a process whenever it is
needed; you manually killing a process is no different than the kernel
killing it to reclaim memory.

On Sep 17, 9:17 pm, Anshul <[EMAIL PROTECTED]> wrote:
> Hackborn,
>
> I am having the same problem as mentioned in the mail thread below
> that my activity is being restarted after I am killing it through DDMS
> or Android shell. My activity starts a service that just prints
> "Hello" in OnCreateFunction using Log class and does nothing else.
> From your e-mail below you mention that an activity would be restarted
> when there are things to be done. In my case there is nothing else to
> be done by the service or the actvity that starts the service, then
> why is it being restarted. Please let me know if my understanding is
> not correct.
>
> Thanks,
> -Anshul
>
> On Mar 7, 11:09 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > Yes, when aprocessis killed, if there are things that need to be
> > running in it (a service that still needs to be running, an activity
> > to interact with the user, and broadcast being received in it), then
> > it will be restarted.
>
> > As for other processes being killed, this happens if aprocesshosting
> > a content provider goes down -- any other processes that are clients
> > of the provider also go down, because of the semantics of cursors
> > (they can't recover a connection when theprocessthey are connected
> > to goes away).  Currently the logic for this is really stupid, in that
> > the system only knows that you used the provider at some point and so
> > has tokilleveryprocessthat has used one of the dying processes
> > providers.  In a future SDK this should be a bit smarter.
>
> > On Mar 7, 8:42 am, tutu <[EMAIL PROTECTED]> wrote:
>
> > > My application has severalprocess: "default", ":remote", ":sys". For
> > > test reason, I killed oneprocesssuch as ":sys" by ddms. I found the
> > >processwill restart in several seconds. I think maybe theprocesshas
> > > several services running, so the system restart it. Is it true? I also
> > > found that if youkilloneprocessby ddms, sometimes other processes
> > > are also be killed. Why?! There were some ContentProvider running in
> > > otherprocess, and were excuted across processes several times. Is it
> > > the reason?
> > > What's the details aboutprocessrestart mechanism?
> > > Thank you very much!- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to