Can android PopupWindow show another PopupWindow?

让人想犯罪 __ 提交于 2019-11-27 23:45:12

After playing with it i've found that

    window.showAtLocation(getWindow().getDecorView(), Gravity.CENTER, x, y);

works okay, but

    window.showAsDropDown(getWindow().getDecorView(), Gravity.CENTER, x, y);

raises exception! If you use showAtLocation(view) with any view different from getWindow().getDecorView() you'll still have an exception.

Yes you can. but here after looking at the exception stack trace, it seems like you are giving the wrong context. try to Launch another dialog with the same context or the context of your activity if that is not a child view of any parent such as TabView.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!