Android 如何创建非阻塞弹出窗口
如何创建非阻塞弹出窗口Android 如何创建非阻塞弹出窗口,android,android-widget,Android,Android Widget,如何创建非阻塞弹出窗口 LayoutInflater inflater = (LayoutInflater) PollRatings.this .getContext().getSystemService( Context.LAYOUT_INFLATER_SERVICE);
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);
但当我显示弹出窗口时,屏幕上的其他小部件都被点击了,我无法点击任何东西如何解决这个问题?也许你们可以使用Toast 然后通过启动计时器并在计时器的运行过程中执行dialog.cancel,尝试从代码中取消对话框。我无法使用Toast,因为我需要重置时间、尝试使用cancel和使用new message新建,但不起作用