关闭Android的弹出窗口回到preSS弹出窗口、Android、preSS

2023-09-06 02:00:07 作者:学神学成神经病

我创造,我创建了一个弹出式屏幕Android应用程序。但是,当我pressing后退按钮,弹出是没有得到关闭。

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.

我曾尝试与onBack pressed()。这是行不通的。

I have tried with onBackPressed(). It is not working.

谁能告诉我该怎么做。

问候,

尚卡尔

推荐答案

您需要做的就是调用 setBackgroundDrawable 在PopupWindow初始化后。是这样的:

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

myPopup.setBackgroundDrawable(new BitmapDrawable());