02-06 05:01:52.806: E/ActivityThread(1120): Activity com.project.xxxActivity
$1@45fc5af8 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 com.baidu.location.LocationClient$1@45fc5af8 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。