Unable to add window …… is your activity running?
来源:互联网 发布:java面向对象基础 编辑:程序博客网 时间:2024/06/05 13:22
今天在改一个项目,其中有一个界面是用webview打开网页(网页有一个dialog),然后我在webview还没加载完的时候把webview所在的activity finish掉。结果报错
Unable to add window …… is your activity running?
我就想可能是activity finish了但webview还在加载页面才会导致出现这个错误。所以就在执行finish()前把执行webview.destroy(),结果又报了一个错误:
Error: WebView.destroy() called while still attached。
谷歌了后才知道当结束webview的时候,Webview还依附在父控件下。所以正确的做法是:
layout.removeView(webview);
webview.removeAllViews();
webview.destroy();
webview.removeAllViews();
webview.destroy();
这样就行了。
0 0
- Unable to add window …… is your activity running?
- Anroid 异常:Unable to add window …… is not valid; is your activity running?
- Anroid 异常:Unable to add window …… is not valid; is your activity running?
- view.WindowManager$BadTokenException: Unable to add window…is not valid; is your activity running?
- BadTokenException:Unable to add window …… is your activity running?is not valid; is your activity ru
- Unable to add window ,is your activity running?
- Unable to add window is not valid; is your activity running?
- Unable to add window — token android.os.BinderProxy is not valid; is your activity running?
- PopupWindow出现Unable to add window -- token null is not valid; is your activity running?
- Anroid 异常:Unable to add window 。。is not valid; is your activity running?
- Unable to add window -- token android.os.BinderProxy@XXX is not valid; is your activity running?
- PopWindow Unable to add window -- token null 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?
- Unable to add window -- token null is not valid; is your activity running?
- Unable to add window --token is not valid; is your activity running?
- - Unable to add window -- token null is not valid; is your activity running?
- Unable to add window -- token null is not valid; is your activity running?
- 插入排序
- 在代码中修改TextView的Drawable图片
- hive函数 -- split 字符串分割函数
- JAVA面向对象内存图
- IPC-Binder连接池
- Unable to add window …… is your activity running?
- Android SDK代理服务器解决国内不能更新下载问题
- android 控件ImageView的常用属性说明
- Python中super关键字的作用
- webAPP有用网站
- C中可变参数的宏
- Docker学习笔记之二,基于Dockerfile搭建JAVA Tomcat运行环境
- 单选框、多选框样式美化
- CodeIgniter RESTful 服务端