我希望能得到这个答案,当我点击外面时,我已经非常努力地关闭弹出窗口,但它没有关闭,有人知道为什么吗?当我单击返回按钮时,它也不会返回。
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();
}