I use an Activity to bind to a Service and from there I call startService()
to have the Service perform a task.
When the Service completes the task it calls stopSelf()
. Naturally, the Service doesn't stop until my Activity unbinds. What happens when the Activity calls startService()
again after the Service's call to stopSelf()
. Will the Service get destroyed once the Activity unbinds or will it continue to run?
Through trial and error it appears that the service continues to run.
The activity's call to startService()
effectively cancels the Services prior call to stopSelf()
.
The code for my experiment can be found here. https://gist.github.com/Proper-Job/56d22b36714e3339be05