Close Android popup window with back press

后端 未结 8 2025
春和景丽
春和景丽 2021-01-05 02:42

I have created a android application where I have created a popup screen. But when I am pressing the back button, popup is not getting closed.

I have tried with onB

8条回答
  •  执笔经年
    2021-01-05 03:01

    What you need to do is call setBackgroundDrawable on your PopupWindow after you initialize it. Something like:

    myPopup.setBackgroundDrawable(new BitmapDrawable());
    

提交回复
热议问题