android.os.BinderProxy cannot be cast to com.android.server.am.Activit 解决办法
来源:互联网 发布:加强网络管理的通知 编辑:程序博客网 时间:2024/05/16 08:43
安卓开发在使用百度地图的过程中,试图通过百度地图获取当前经纬度 控制台报错:
Bad activity token: android.os.BinderProxy
java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.android.server.am.ActivityRecord$Token
原因是调用 LocationClient 初始化的时候 使用了
locationClient = new LocationClient(this);
如果当前 activity 不是 Main 启动的话。
需 把上面代码改成:
locationClient = new LocationClient(getApplicationContext());
即可
0 0
- android.os.BinderProxy cannot be cast to com.android.server.am.Activit 解决办法
- java.lang.ClassCastException:android.os.BinderProxy cannot be cast to...
- java.lang.ClassCastException:android.os.BinderProxy cannot be cast to com.
- 绑定service报错: java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.lubo.fmdigit
- android.os.BinderProxy cannot be cast to cq.cake.servicetest.MyService错误
- java.lang.ClassCastException: android.os.BinderProxy cannot be cast to ………………
- java.lang.ClassCastException: android.os.BinderProxy cannot be cast to ………………
- Android在绑定service的时候出现java.lang.ClassCastException:android.os.BinderProxy cannot be cast to ...异常
- BitmapDrawable cannot be cast to android.graphics.drawable.AnimationDrawable解决办法
- ClassCastException: $Proxy0 cannot be cast to (com......) 的解决办法
- cannot be cast to android.widget.HeaderViewListAdapter
- cannot be cast to android.app.Fragment
- cannot be cast to android.widget.HeaderViewListAdapter
- android.app.Application cannot be cast to
- cannot be cast to android.widget.HeaderViewListAdapter
- cannot be cast to android.widget.HeaderViewListAdapter
- cannot be cast to android.widget.HeaderViewListAdapter
- cannot be cast to android.widget.HeaderViewListAdapter
- pjsip 视频部分学习思路
- android中listview的一些样式设置
- HTMLParser使用详解
- 网络电子采购系统的一些介绍
- ONE源代码分析——movement4之BusMovement
- android.os.BinderProxy cannot be cast to com.android.server.am.Activit 解决办法
- 【leetcode】Longest Substring Without Repeating Characters
- pjsua帮助手册(中文)
- ios之获取图库图片
- 《读 大 学 ,究 竟 读什 么 》
- 在Centos 5.2上安装Xen并创建windows 2003虚拟机
- 装系统。。。
- Html注意事项
- 利用session完成登录