I have a PopupWindow and I wanted it to dismiss when the user touches outside, so I looked into and found out that I had to use popup.setBackgroundDrawable(new BitmapDrawa
Hmm setBackgroundDrawable don't dissmiss popup window. I think that default behavior of popup window is to dismiss on touching outside but you may add onDismiss listener like that
popup.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
popup.dismiss();
// end may TODO anything else
}
});