I wanted to dismiss the PopupWindow
when touch outside, I got that answer from this SO question.
Here they asked to inlude these two line of code.
myPopupWindow.setBackgroundDrawable(new BitmapDrawable());
myPopupWindow.setOutsideTouchable(true);
Now the Popup disappers when i touch outside of PopupWindow
.
setOutsideTouchable(true);
alone is not working. when i set the background Drawable,it is working.
How this magic happens ? can anyone explain on this?
Also new BitmapDrawable()
is deprecated. is there any alternative for this ?