private void newGame() {
LayoutInflater inflater = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final PopupWindow pw = new PopupWindow(inflater.inflate(
R.layout.settings, null, true), 300, 600, true);
pw.showAtLocation(this.findViewById(R.id.settings), Gravity.RIGHT, 0, 0);
pw.setTouchInterceptor(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// your code when touched on the event
return false;
}
});
}
我在这里发布了我的代码。我得到了弹出窗口。但我不知道如何添加事件到弹出窗口,并使其在点击后不可见。如何解开一个弹出窗口?
thanks..I使用的,但其不工作。 – preeti
您是否收到错误?你检查日志吗? – bluefalcon
我没有收到error.Its运行,但弹出式窗口不会被解雇。 – preeti