如何创建非阻塞弹出窗口

时间:2012-03-13 12:52:23

标签: android android-widget

如何创建非阻塞弹出窗口

                         LayoutInflater inflater = (LayoutInflater)
                         PollRatings.this
                         .getContext().getSystemService(
                         Context.LAYOUT_INFLATER_SERVICE);
                         View layout = inflater
                         .inflate(R.layout.toast, null);
                         PopupWindow pw = new PopupWindow(layout, 300,
                         470,
                         true);
                         pw.setFocusable(true);
                         pw.setOutsideTouchable(true);
                         pw.setTouchable(true);
                         pw.showAtLocation(layout, Gravity.CENTER, 0, 0);

但是当我显示弹出窗口时,屏幕上的其他小部件都被点击(我无法点击任何内容)请问解决这个问题?

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

然后尝试通过启动计时器并在计时器的run()过程中执行dialog.cancel()来从代码中取消对话框。