调用关闭/取消后,AlertDialog 不起作用?
我有一个带有 3 个单选按钮的 AlertDialog。单击按钮时会显示警报。
当用户在 AlertDialog 中选择单选按钮时,我调用 dialog.dismiss();
。这里的“对话框”来自 public void onClick(DialogInterfacedialog, int item) {
现在的问题是,在选择一个项目后,我似乎无法再次弹出警报。令人惊讶的是,在屏幕旋转时,一切似乎又恢复正常了!
当我用 dialog.cancel();
替换 dialog.dismiss();
时,我也得到相同的结果(即它不起作用),
请指教!
I have an AlertDialog with 3 radio buttons.The alert is shown when a button is clicked.
I call dialog.dismiss();
when a radio button is selected by the user in the AlertDialog. Here "dialog" is frompublic void onClick(DialogInterface dialog, int item) {
Now the issue is that I cannot seem to pop up the Alert again after an item has been selected. Suprisingly, on a screen rotation everything seems to work fine again!
I also get the same results (i.e it does not work) when I replace dialog.dismiss();
with dialog.cancel();
Please advice!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果可以的话,请发布整个活动。看来问题在于如何以及在何处初始化对话框。
Please post the whole activity if you could. Seems like the problem would be how and where you're initializing the dialog.