android窗体溢出WindowManager$BadTokenException: Unable to add window -- token null is not for an applica

来源:互联网 发布:软件培训方案 编辑:程序博客网 时间:2024/05/18 10:03
10-28 03:29:18.745: E/AndroidRuntime(1238): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

1、由于Activity结束之前没关闭窗体
2、dialog不能使用getApplicationContext(),因为只有Activity才能添加窗体

在Activity结束,调用关闭窗体的方法
Dismiss();

0 0
原创粉丝点击