首页 > 移动平台 > 详细

AlertDailog: android.view.WindowManager$BadTokenException: Unable to add window -- token null is no

时间:2014-03-01 04:15:29      阅读:1041      评论:0      收藏:0      [点我收藏+]

错误内容:AlertDailog:  android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application

 原因:new Dialog(context)在创建Dialog时传递的context不是Context的getApplicationContext,而是Activity的context对象
解决方案:传递参数getApplicationContext()改为Activity类名.this,

 

 

我的QQ群:373643359,欢迎加入

 

AlertDailog: android.view.WindowManager$BadTokenException: Unable to add window -- token null is no,布布扣,bubuko.com

AlertDailog: android.view.WindowManager$BadTokenException: Unable to add window -- token null is no

原文:http://blog.csdn.net/niuba123456/article/details/20141925

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!