Error:android.app.ServiceConnectionLeaked:就是leaked ServiceConnection的错误
2017-12-19 15:47
489 查看
在做activity和service绑定时候,出现了这个错误。
android.app.ServiceConnectionLeaked: Activity com.dxn.xtgascehui.activity.MappingActivity has leaked
XServiceConnection com.dxn.xtgascehui.activity.MappingActivity$2
@926151f that was originally bound here
最后发现是只做了绑定,未做解绑。
解决办法:在onDestory()方法中解绑就可以了
android.app.ServiceConnectionLeaked: Activity com.dxn.xtgascehui.activity.MappingActivity has leaked
XServiceConnection com.dxn.xtgascehui.activity.MappingActivity$2
@926151f that was originally bound here
最后发现是只做了绑定,未做解绑。
解决办法:在onDestory()方法中解绑就可以了
//解绑服务 if (mService == null) { return; } try { mService.removeUpdates(listener); } catch (RemoteException e) { e.printStackTrace(); } unbindService(mConnection);
相关文章推荐
- android中使用WebView报出错误 Activity has leaked ServiceConnection android.speech.tts.TextToSpeech$Connecti
- android.app.ServiceConnectionLeaked: that was originally bound here
- (原)android系统下绑定Server的时候报MainActivity has leaked ServiceConnection的错误
- Android错误之:Error:Execution failed for task ':app:mergeDebugResources'.
- Service com.android.exchange.ExchangeService has leaked ServiceConnection
- Android错误:The connection to adb is down, and a severe error has occured.
- 关于错误:android.app.RemoteServiceException: Bad notification posted from package
- Service com.android.exchange.ExchangeService has leaked ServiceConnection
- Android错误——The connection to adb is down, and a severe error has occured 解决方案
- 关于错误:android.app.RemoteServiceException: Bad notification posted from package
- <错误处理> Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessExc
- 【Android错误总结】Adb connection Error:远程主机强迫关闭了一个现有的连接
- 停止服务时报异常!ERROR/ActivityThread(358): Service com.wd.AndroidDaemon.WandouService has leaked IntentRece
- Android studio编译错误二:Error: The WIFI_SERVICE must be looked up on the Application
- android开发之关于提高第三方app的service优先级(以及例举网上常见的错误方法)
- Android Service com.android.exchange.ExchangeService has leaked ServiceConnection
- 解决android项目Error:Execution failed for task ':app:dexDebug'.ebug'错误
- ANDROID打包错误ERROR:EXECUTION FAILED FOR TASK ´:APP:LINTVITALRELEASE´.
- ANDROID打包错误ERROR:EXECUTION FAILED FOR TASK ´:APP:LINTVITALRELEASE´.
- 百度地图sdk---地图定位功能的错误has leaked ServiceConnection com.baidu.location.LocationClient