【发布时间】:2014-05-19 08:40:20
【问题描述】:
我有一个从当前片段打开的扩展 DialogFragment。 最近我发现可以单击导致对话框在短时间内打开两次的元素,它会强制打开两个对话框。这是我的应用程序的意外行为。我想让可能只打开一个对话框实例。我做错了什么?
下面是我打开对话框的代码。
public boolean onActionItemSelected(int menuId) {
switch (menuId) {
case R.id.action_change_passcode:
pinChangeFlag = true;
AbstractPinDialog pinChangeFirstDialog = new StandardPinDialog(this);
pinChangeFirstDialog.show(getFragmentManager(), StandardPinDialog.class.getName());
return true;
//... other cases
}
}
【问题讨论】:
-
Id
action_change_passcodeaButton? -
@Apoorv 这是来自 ActionBar 的项目代码
标签: android android-fragments dialog