Question

I'm messing with Android services, and I have found that ServiceConnection.onServiceConnected() gets called fairly predictably when I bind to a service.

However, my onServiceDisconnected() method seems to never be called, even after the VM dies.

I have logged debug messages on the service and show that all threads have been shutdown, etc. I know services are implemented as processes; are there threads I don't know about that are preventing the process from exiting?

Was it helpful?

Solution

It happens upon remote service crash. So, if a service running in a different process than your client fails on some exception, you lose the connection and get the callback.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top