Unable to add window -- token android.os.BinderProxy@164db98f is not valid解决办法f
来源:互联网 发布:增值税发票数据分析 编辑:程序博客网 时间:2024/05/16 01:18
有一次在项目中用Dialog的时候出现了闪退,报了一个“Unable to add window -- token android.os.BinderProxy@164db98f is not valid; is your activity running?”的异常;
我出现异常的情况是进入一个页面,等这个页面的数据加载完后弹出一个dialog,但是我在dialog还没弹出的时候就finish掉了这个页面,这个时候就会出现如上的异常情况。出现这种情况,我的分析是在dialog还没有显示的时候就finish掉了它要显示的Activity,所以等它显示的时候,它要显示的Activity已经finish了;
解决办法如下,在显示之前调用activity的isFinishing方法判断一下,如果是false再显示:
if(!YourActivity.this.isFinishing()){ showDialog(YourActivity.this);}
0 0
- Unable to add window -- token android.os.BinderProxy@164db98f is not valid解决办法f
- Unable to add window — token android.os.BinderProxy is not valid; is your activity running?
- Unable to add window -- token android.os.BinderProxy@XXX is not valid; is your activity running?
- Unable to add window -- token android.os.BinderProxy@xxx is not valid; is your activity running
- Unable to add window — token android.os.BinderProxy is not valid; is your activity running?
- Android问题集(4):Unable to add window -- token android.os.BinderProxy@bf4921f is not valid;
- BadTokenException: Unable to add window -- token android.os.BinderProxy@438e7108 is not valid;
- Unable to add window -- token android.os.BinderProxy@bf4921f is not valid
- Unable to add window -- token android.os.BinderProxy@bf4921f is not valid
- 【遇见Android bug】Unable to add window -- token android.os.BinderProxy@4396ecc8 is not valid; is your a
- Android程序报错:Unable to add window——token android.os.BinderProxy@431e65b8 is not valid
- Android程序报错:Unable to add window——token android.os.BinderProxy@431e65b8 is not valid
- WindowManager$BadTokenException: Unable to add window — token android.os.BinderProxy@465 is not vali
- android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@f
- unable to add window -- token null is not valid; is your activity running 错误解决办法
- Unable to add window -- token null is not valid
- Unable to add window -- token null is not valid
- unable to add window token null is not valid
- 集合初探(七)
- Shell Script 基础
- RDD创建彻底解密
- 弹出框提示的使用 - 不是很完善
- chrdevs数组
- Unable to add window -- token android.os.BinderProxy@164db98f is not valid解决办法f
- Android 自定义控件:入门篇之自定义验证码
- office2007每次打开都要配置文件,怎么取消配置
- 2015 年 Ruby 大盘点
- swift数组与字典
- Linux 双物理网卡绑定成一个虚拟网卡
- 网络加密解密原理(三) RSA加密解密及数字签名Java实现
- CPP Primer 5th 笔记(一)
- 日期类