Unable to add window -- token null is not for an application
来源:互联网 发布:淘宝商品色差严重 编辑:程序博客网 时间:2024/04/27 23:50
android.view.WindowManager$BadTokenException:Unable to add window -- token null is not for anapplication
分析:
问题在于newAlertDialog.Builder(Context),虽然这里的参数是AlertDialog.Builder(Contextcontext)
但我们不能使用getApplicationContext()获得的Context,而必须使用Activity的Context对象,因为只有一个Activity才能添加一个窗体。
解决方法:
将new AlertDialog.Builder(Contextcontext)中的参数用Activity的Context对象即可.
0 0
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- Unable to add window -- token null is not for an application错误的解决方法
- Android Custom Dialog错误Unable to add window -- token null is not for an application
- Android Custom Dialog错误Unable to add window -- token null is not for an application
- Unable to add window -- token null is not for an application 的解决办法
- Unable to add window -- token null is not for an application
- AlertDialog:Unable to add window -- token null is not for an application
- Unable to add window -- token null is not for an application
- Android Custom Dialog错误Unable to add window -- token null is not for an application
- Unable to add window -- token null is not for an application
- AlertDialog显示错误 Unable to add window token null is not for an application
- Unable to add window -- token null is not for an application
- Unable to add window -- token null is not for an application:
- AlertDialog显示错误 Unable to add window token null is not for an application
- android AlertDialog显示错误 Unable to add window token null is not for an application
- popupwindow 全屏遮罩并解决SDK>21窗口最上方状态栏无法遮罩
- SQL的主键和外键约束
- iOS UILabel的自适应宽高和文本渐变色
- blade模块命令集
- 第五周 项目1:建立顺序栈算法库
- Unable to add window -- token null is not for an application
- 第五周-项目五 后缀表达式
- viewpager的使用技巧
- 支付宝(一)
- 神经网络-前向传播
- 【第五周项目3-括号的匹配】
- Parajumpers Herren jacke long bear did
- How to run keystone testcase against the DB backend other than SQLITE
- 解决mysql数据库登录报1045错误,修改root密码