Wednesday, July 27, 2011

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

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