【第22期】观点:IT 行业加班,到底有没有价值?

Service was originally bound here

原创 2015年11月20日 11:24:11

1.错误原因:

在Activity运行了bindService()开启Service(全名:

boolean android.content.ContextWrapper.bindService(Intent service,ServiceConnection conn, int flags));但在destory()里没有调用unbindService ()关闭Service(

void android.content.ContextWrapper.unbindService(ServiceConnection conn));

就会出现这种异常;
1.解决办法,在Activity中destory()里加上unbindService(ServiceConnection conn)即可;

1.贴出我的throw Exception,仅作参考:

11-20 16:22:03.012: E/ActivityThread(6004):

android.app.ServiceConnectionLeaked:Activitycom.android.bluetooth.DeviceScanActivity has leaked ServiceConnectioncom.android.bluetooth.DeviceScanActivity$1@428afb28 that was originally boundhere;

at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:972);

at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:866);

at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1637);

atandroid.app.ContextImpl.bindService(ContextImpl.java:1620);

at android.content.ContextWrapper.bindService(ContextWrapper.java:517);

atcom.android.bluetooth.DeviceScanActivity.addDevice (DeviceScanActivity.java:542);

at com.android.bluetooth.DeviceScanActivity$3$1.run(DeviceScanActivity.java:308);

atandroid.os.Handler.handleCallback(Handler.java:733);

atandroid.os.Handler.dispatchMessage(Handler.java:95);

at android.os.Looper.loop(Looper.java:136);

atandroid.app.ActivityThread.main(ActivityThread.java:5133);

atjava.lang.reflect.Method.invokeNative(Native Method);

atjava.lang.reflect.Method.invoke(Method.java:515);

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795);

atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:611);

at dalvik.system.NativeStart.main(NativeMethod);


版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

Android开发之服务连接泄露异常

写了个Android service,用来完成一些耗时的网络IO和远程设备连接。在Activity中,先用startService( )启动服务,然后调用bindService( )将Activity...

service 没有unbind时was originally bound here错误

service 没有unbind时was originally bound here错误 service 没有unbind时was originally bound here错误    在程序中,...

出现leaked ServiceConnection 的解决办法

出现leaked ServiceConnection 的解决办法Activity com.skyace.service.MainActivity has leaked ServiceConnectio...

Activity has leaked ServiceConnection that was originally bound here

当我们采用bindService(service, conn, flags)而不是 startService(service)启动服务Service的时候,如果我们在关闭Activity的时候没有释放...

Activity has leaked ServiceConnection that was originally bound here

当我们采用bindService(service, conn, flags)而不是 startService(service)启动服务Service的时候,如果我们在关闭Activity的时候没有释放...

Diameter 协议

Network Working Group P. CalhounRequest for Comments: 3588 Airespace, Inc.Category: Standards Track J. Loughney Nokia E. Guttman Sun Microsystems, Inc. G. Zorn Cisco Systems, Inc. J. Arkko Ericsson September 2003 Diameter

service 没有unbind时was originally bound here错误

service 没有unbind时was originally bound here错误 service 没有unbind时was originally bound here错误    在程序中,...
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)