如何检查是否显示对话框或显示相同类型的多个对话?多个、对话框、类型

由网友(爱比糖果甜)分享简介:我在的ShowDialog / dismissDialog / removeDialog 。 我想:显示几个对话框实物一叠:Display several dialogs in kind of a stack:a)首先对话框的ShowDialog(DIALOG_TYPE) 二)接下来的对话框显示在现有的...

我在的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?

推荐答案

对话框中有一个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().