I was hoping to get the answer for this, I have tried very much to dismiss the popup window when I click outside, but it is not dismissing, anybody know why? Also it is not going back when I click back button.
public void onButtonPopup (View target) {
// Make a View from our XML file
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.samplescreens, (ViewGroup) findViewById(R.id.closeLayout));
pwindo = new PopupWindow(layout, width-40, height-(height/4), true);
pwindo.showAtLocation(layout, Gravity.CENTER, 0, 0);
pwindo.update();
pwindo.setOutsideTouchable(true);
}
public void onButtonInPopup (View target) {
//back_dim_layout.setVisibility(View.GONE);
pwindo.dismiss();
}