Service was originally bound here
来源:互联网 发布:票房数据排行榜 编辑:程序博客网 时间:2024/05/16 11:49
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);
- Service was originally bound here
- service 没有unbind时was originally bound here错误
- android 出现 was originally bound here错误
- android.app.ServiceConnectionLeaked: that was originally bound here
- Activity has leaked ServiceConnection that was originally bound here
- has leaked ServiceConnection com.baidu.location.LocationClient that was originally bound here 百度地图
- 解决百度地图使用出现的has leaked ServiceConnection com.baidu.location.b@4aa5a810 that was originally bound here
- 关于WindowManager的一个小问题was originally added here
- Android 开发 Tip 3 -- that was originally added here
- 问题:Activity has leaked window android.widget.RelativeLayout@407cd588 that was originally added here
- Android常见错误之android.widget.LinearLayout@4375f248 that was originally added here
- Android 警告提示:Activity has leaked window xxxxx was originally added here
- Android 报错:has leaked window XXXXX that was originally added here
- has leaked IntentReceiver ...that was originally registerd here.Are you missing a call to unregister
- has leaked window com.android.internal.policy.impl.PhoneWindow$ that was originally added here异常解决
- 【已解决】Activity MainActivity has leaked window PhoneWindow$DecorView@ that was originally added here
- has leaked window com.android.internal.policy.impl.PhoneWindow$ that was originally added here
- Activity has leaked IntentReceiver that was originally registered here. Are you missing a call to un
- Semaphore使用
- 机器学习实战python版归一化数值和测试kNN算法以及构建完整可用系统
- win7系统下安装VS2010和IIS7问题汇总
- POJ 3259 *** Wormholes
- linux的文件结构详解
- Service was originally bound here
- 社会生活十大著名法则
- 对办公文件的操作
- JavaService将jar发布为windows 服务
- Linux 内核引导参数简介
- Java对日期Date类进行加减运算,年份加减,月份加减,时间差等等
- log4j NDC 用法小例子
- 解决Fragment重叠问题
- Sql语句备份数据库