Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
When android unbind a service I created (service.MyService), I see the
following DeadObjectException.
Can you please tell me how what does this mean and can I fix this exception?
W/ActivityManager( 583): Exception when unbinding service
com.mycompany/.service.MyService
W/ActivityManager( 583): android.os.DeadObjectException
W/ActivityManager( 583): at
android.os.BinderProxy.transact(Native Method)
W/ActivityManager( 583): at
android.app.ApplicationThreadProxy.scheduleUnbindService(ApplicationThreadNative.java:516)
W/ActivityManager( 583): at
com.android.server.am.ActivityManagerService.removeConnectionLocked(ActivityManagerService.java:9609)
W/ActivityManager( 583): at
com.android.server.am.ActivityManagerService.killServicesLocked(ActivityManagerService.java:8515)
Thank you.
This means that your service had already stopped - either killed from the OS, or stopped from your application.
Does this problem happen every time you debug your project?
Override your service's onDestroy()
method and watch what event flow leads to it. If you catch DeadObjectException
without going through this method, your service should have been killed by the OS.
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.