Can android PopupWindow show another PopupWindow?

前端 未结 2 1163
深忆病人
深忆病人 2020-12-06 06:00

Can android PopupWindow show another PopupWindow? How many PopupWindow can be opened in the same time? Only one?

The first PopupWindow is displayed normally. But on

相关标签:
2条回答
  • 2020-12-06 06:36

    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.

    0 讨论(0)
  • 2020-12-06 06:48

    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.

    0 讨论(0)
提交回复
热议问题