如何检查是否显示对话框或显示相同类型的多个对话? [英] How to check if dialog is displayed or display multiple dialogs of the same type?

查看:98
本文介绍了如何检查是否显示对话框或显示相同类型的多个对话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在的ShowDialog / dismissDialog / removeDialog

我想:

显示几个对话框实物一叠:

Display several dialogs in kind of a stack:

a)首先对话框的ShowDialog(DIALOG_TYPE)

二)接下来的对话框显示在现有的对话框顶部

b) Next dialogs are shown on top of the existing dialog

现在,我只能够用来显示第一个对话框的ShowDialog ,然后在下一个对话框中会被忽略。

Now I'm only able to display first dialog using showDialog and then next dialogs are ignored.

显示最后一个对话框:

a)首先对话框的ShowDialog(DIALOG_TYPE)

二)申请检查是否显示对话框,关闭对话框(如果它出现),并打开一个新的对话框。

b) Application checks if dialog is displayed, closes dialog (if it's displayed) and opens a new dialog.

是否有可能实现上述解决方案之一?

Is there any possibility to achieve one of the above solutions?

推荐答案

对话框中有一个<一个href="http://developer.android.com/reference/android/app/Dialog.html#isShowing%28%29">isShowing()方法应该返回如果对话框是当前可见。所以,你可以用它来看看一个对话框显示和隐藏它dismissDialog()。你只需要保持一个引用您在onCreateDialog()。

Dialog has an isShowing() method that should return if the dialog is currently visible. So you can use that to see if a dialog is showing and hide it with dismissDialog(). You just have to keep a reference to the Dialogs you create in onCreateDialog().

这篇关于如何检查是否显示对话框或显示相同类型的多个对话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆