Activity com.example.mymapdemo.MainActivity has leaked ServiceConnection com.baidu.location.Locati

07-21 10:23:28.153: E/dalvikvm(17264): GC_CONCURRENT freed 1143K, 17% free 7813K/9351K, paused 2ms+2ms, total 33ms
07-21 10:23:30.023: E/ActivityThread(17264): Activity com.example.mymapdemo.MainActivity has leaked ServiceConnection com.baidu.location.LocationClient$1@41482130 that 


was originally bound here
07-21 10:23:30.023: E/ActivityThread(17264): android.app.ServiceConnectionLeaked: Activity com.example.mymapdemo.MainActivity has leaked ServiceConnection 


com.baidu.location.LocationClient$1@41482130 that was originally bound here
07-21 10:23:30.023: E/ActivityThread(17264): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:977)
07-21 10:23:30.023: E/ActivityThread(17264): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:871)
07-21 10:23:30.023: E/ActivityThread(17264): at android.app.ContextImpl.bindService(ContextImpl.java:1237)
07-21 10:23:30.023: E/ActivityThread(17264): at android.app.ContextImpl.bindService(ContextImpl.java:1229)
07-21 10:23:30.023: E/ActivityThread(17264): at android.content.ContextWrapper.bindService(ContextWrapper.java:394)
07-21 10:23:30.023: E/ActivityThread(17264): at com.baidu.location.LocationClient.for(Unknown Source)
07-21 10:23:30.023: E/ActivityThread(17264): at com.baidu.location.LocationClient.goto(Unknown Source)
07-21 10:23:30.023: E/ActivityThread(17264): at com.baidu.location.LocationClient$a.handleMessage(Unknown Source)
07-21 10:23:30.023: E/ActivityThread(17264): at android.os.Handler.dispatchMessage(Handler.java:99)
07-21 10:23:30.023: E/ActivityThread(17264): at android.os.Looper.loop(Looper.java:137)
07-21 10:23:30.023: E/ActivityThread(17264): at android.app.ActivityThread.main(ActivityThread.java:4829)
07-21 10:23:30.023: E/ActivityThread(17264): at java.lang.reflect.Method.invokeNative(Native Method)
07-21 10:23:30.023: E/ActivityThread(17264): at java.lang.reflect.Method.invoke(Method.java:511)
07-21 10:23:30.023: E/ActivityThread(17264): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
07-21 10:23:30.023: E/ActivityThread(17264): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)

07-21 10:23:30.023: E/ActivityThread(17264): at dalvik.system.NativeStart.main(Native Method)


由于缺少服务,

因此异常只需在manifest中添加一些代码即可:

  <service

            android:name="com.baidu.location.f"
            android:enabled="true"
            android:process=":remote" >
        </service>

你可能感兴趣的:(java,android,异常,application)