Close Android popup window with back press

后端 未结 8 2021
春和景丽
春和景丽 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:00

    popup.setBackgroundDrawable(new BitmapDrawable());
    
    popup.setOnDismissListener(new PopupWindow.OnDismissListener() {
                @Override
                public void onDismiss() {
                    //do your code here
                }
            });
    

提交回复
热议问题