PopupWindow上弹出另一个PopupWindow报异常解决办法

来源:互联网 发布:安卓模拟器for mac 编辑:程序博客网 时间:2024/05/13 20:38

在做项目中用到在一个PopupWindow上点击某个按钮弹出另一个PopupWindow的功能。


但是缺报错了:

android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRoot$W@44ef1b68 is not valid; is your activity running?

问题主要出在:

mPopupWindow.showAtLocation(mToken, Gravity.NO_GRAVITY, x, y);// 显示
中的mToken中。




0 2
原创粉丝点击