views:

198

answers:

1

I created the AlertDialog using the builder...It can shows when we call the show() method... i have the cancel button in that dialog...i can cancel that dialog by click the cancel button..My problem is once i canceled the displaying dialog...i can't show the dialog at next time...it throws some exception like the following

    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)
+1  A: 

Don't show the same dialog, create a new one.

Konstantin Burov