我在活动中有弹出窗口。我想要的是这个弹出窗口在3秒后开始,当活动被创建并且持续3秒钟时。请帮忙吗?活动创建3秒后显示PopupWindow 3秒
这里是我的代码:
try {
LayoutInflater inflater1 = (LayoutInflater) MainActivity.this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// Inflate the view from a predefined XML layout
View layout = inflater1.inflate(R.layout.activity_pop_up,
(ViewGroup) findViewById(R.id.relativeLayoutZaFragment));
// create a 300px width and 470px height PopupWindow
pw = new PopupWindow(layout, 300, 470, true);
// display the popup in the center
pw.showAtLocation(layout, Gravity.CENTER, 0, 0);
} catch (Exception e) {
e.printStackTrace();
}
我不能在oncreate()方法中实现这一点。 – smiljka
布尔显示上面创建,其余在创建 –
当我实现这个弹出不断屏幕上,我需要以某种方式解雇 – smiljka