Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close Android popup window with back press

Tags:

android

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 onBackPressed(). It is not working.

Can someone tell me what to do.

Regards,

Shankar

like image 503
Bhabani Shankar Avatar asked Aug 04 '11 10:08

Bhabani Shankar


1 Answers

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

myPopup.setBackgroundDrawable(new BitmapDrawable());
like image 64
IgorGanapolsky Avatar answered Sep 29 '22 19:09

IgorGanapolsky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!