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

2011-07-27 Thread Droid
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

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

2011-07-27 Thread m.andrew
When an application process is killed all threads of this process are also killed. If killed application doesn't have a service a new process of this application wont start. But if killed application has a service a new process will start and service will be recreated. Does returned value of

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

2011-07-27 Thread Droid
As far as I remember I had to cancel the service specifically. Killing the App's pid is not sufficient. Even a timer thread can bring the App back. I do not know how to do that from adb. From Java code its easy as you know (service cancel()). Sorry if I am no help to you. I just remember this

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

2011-07-27 Thread m.andrew
Thanks for the replies, Yes, I know how to stop a service from source code. But the idea of START_NOT_STICKY flag is not clear for me in this case. Because the documentation says: START_NOT_STICKY - If the system kills the service after onStartCommand() returns, do not recreate the service,