service 没有unbind时was originally bound here错误
service 没有unbind时was originally bound here错误
在程序中,如果在activity中绑定了服务,而没有在destory中,写unbind,会出现这种异常,
Activity com.neusoft.dsn.infoplayer.InfoPlayerActivity has leaked ServiceConnection com.neusoft.dsn.infoplayer.InfoPlayerActivity$2@405189f8 that was originally bound here
解决办法,在destory中,加上context.unbindService(u'r ServiceConnection)
Activity com.neusoft.dsn.infoplayer.InfoPlayerActivity has leaked ServiceConnection com.neusoft.dsn.infoplayer.InfoPlayerActivity$2@405189f8 that was originally bound here
解决办法,在destory中,加上context.unbindService(u'r ServiceConnection)
本文介绍了一个常见问题:在Android开发中,若Activity绑定Service后未正确解除绑定,会导致ServiceConnection泄漏。文章提供了具体的解决方法,即确保在Activity销毁时调用unbindService。
597

被折叠的 条评论
为什么被折叠?



