Wednesday, July 27, 2011

[android-developers] Re: Why does Android restart killed service?

The service is on some type of thread which you have not killed. As
far as I remember you have to use a cancel() service commnand in the
java code.

They can be hard to stop if you don't.

On Jul 27, 12:58 pm, "m.andrew" <andreymandyc...@gmail.com> wrote:
> Hi!
>
> I have an application with an activity and a service. The service is
> started by startService() and the activity is bound to it. The
> overridden onStartCommand() method returns START_NOT_STICKY. So I
> suppose that service will not be recreated if it's killed. But it
> will.
>
> I kill the application process by the command: adb shell kill <pid>.
> After killing the process the log shows that new process of my
> application is started again and the service is recreated.
>
> So my question is: Why does Android restart this service (the killed
> process)?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment