Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我还有一个问题。我在 onCreate 上显示了一个警报对话框。问题是,如果我关闭屏幕并重新打开,对话框将再次出现,所以屏幕解锁后我有两个内容相同的对话框。如何解决此问题以不显示对话框已显示?
谢谢!
快速修复:
// your class starts here int x=0; // your onCreate starts here if(x==0){ alert.show(); x=1; }
警报对话框关闭代码
alert.dismiss(); x=0;
它会起作用