我AlertDialog
使用构建器创建了。它显示我们何时调用该show()
方法。我在该对话框中有取消按钮。我可以通过单击取消按钮来取消该对话框。我的问题是一旦我取消显示对话框,我就无法再次显示对话框。它抛出一个异常,如:
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.view.ViewGroup.addViewInner(ViewGroup.java:1970)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.view.ViewGroup.addView(ViewGroup.java:1865)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.view.ViewGroup.addView(ViewGroup.java:1845)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at com.android.internal.app.AlertController.setupView(AlertController.java:364)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at com.android.internal.app.AlertController.installContent(AlertController.java:205)
09-09 12:25:06.441: ERROR/AndroidRuntime(2244): at android.app.AlertDialog.onCreate(AlertDialog.java:251)