has leaked ServiceConnection com.baidu.location.LocationClient

Posted 狂奔的小狮子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了has leaked ServiceConnection com.baidu.location.LocationClient相关的知识,希望对你有一定的参考价值。

02-06 05:01:52.806: E/ActivityThread(1120): Activity com.project.xxxActivity 

[email protected] that was originally bound here 02-06 05:01:52.806: E/ActivityThread(1120): android.app.ServiceConnectionLeaked: Activity com.project.main.xxxActivity has leaked ServiceConnection [email protected] that was originally bound here 02-06 05:01:52.806: E/ActivityThread(1120): at android.app.ActivityThread$PackageInfo$ServiceDispatcher.<init>(ActivityThread.java:1121) 02-06 05:01:52.806: E/ActivityThread(1120): at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:1016) 02-06 05:01:52.806: E/ActivityThread(1120): at android.app.ContextImpl.bindService(ContextImpl.java:863) 02-06 05:01:52.806: E/ActivityThread(1120): at android.content.ContextWrapper.bindService(ContextWrapper.java:347) 02-06 05:01:52.806: E/ActivityThread(1120): at com.baidu.location.LocationClient.cy(Unknown Source) 02-06 05:01:52.806: E/ActivityThread(1120): at com.baidu.location.LocationClient.do(Unknown Source) 02-06 05:01:52.806: E/ActivityThread(1120): at com.baidu.location.LocationClient$a.handleMessage(Unknown Source) 02-06 05:01:52.806: E/ActivityThread(1120): at android.os.Handler.dispatchMessage(Handler.java:99) 02-06 05:01:52.806: E/ActivityThread(1120): at android.os.Looper.loop(Looper.java:123) 02-06 05:01:52.806: E/ActivityThread(1120): at android.app.ActivityThread.main(ActivityThread.java:4627) 02-06 05:01:52.806: E/ActivityThread(1120): at java.lang.reflect.Method.invokeNative(Native Method) 02-06 05:01:52.806: E/ActivityThread(1120): at java.lang.reflect.Method.invoke(Method.java:521) 02-06 05:01:52.806: E/ActivityThread(1120): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 02-06 05:01:52.806: E/ActivityThread(1120): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 02-06 05:01:52.806: E/ActivityThread(1120): at dalvik.system.NativeStart.main(Native Method)

new LocationClient 这个的时候 需要用 getApplicationContext。
  

以上是关于has leaked ServiceConnection com.baidu.location.LocationClient的主要内容,如果未能解决你的问题,请参考以下文章

Activity has leaked window that was originally added

Activity has leaked window that was originally added

Activity has leaked window 原来是加了logcat错误

Android Activity has leaked window that was originally added

修复A Native Collection has not been disposed, resulting in a memory leak.

Android 模拟器向 logcat 发送垃圾邮件,内容为“Service com.android.exchange.ExchangeService has leaked ServiceConnec