解决has leaked ServiceConnection com.baidu.location.c@427b6780

装载:https://blog.csdn.net/u011057161/article/details/50474677

解决“has leaked ServiceConnection com.baidu.location.c@427b6780 that was originally bound here”的错误,需要修改AndroidManifest.xml文件。

配置Map定位权限和远程链接机制。不然,就会报下面的错误:

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. has leaked ServiceConnection com.baidu.location.c@427b6780 that was originally bound here  
  2.     android.app.ServiceConnectionLeaked: Activity XX.XX.XX.XXXXActivity has leaked ServiceConnection com.baidu.location.c@427b6780 that was originally bound here  
  3.             at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)  

        方法:

添加定位权限:

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. <uses-permission android:name="android.permission.BAIDU_LOCATION_SERVICE" />  

        再<application></application>之间添加下面service标签。

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. <service  
  2.         android:name="com.baidu.location.f"  
  3.         android:enabled="true"  
  4.         android:process=":remote" >  
  5. </service>  

猜你喜欢

转载自blog.csdn.net/m0_37039192/article/details/80590304