关闭Android的弹出窗口回到preSS [英] Close Android popup window with back press
本文介绍了关闭Android的弹出窗口回到preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创造,我创建了一个弹出式屏幕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());
这篇关于关闭Android的弹出窗口回到preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文