Codigami / CFAlertDialog

MIT License
224 stars 47 forks source link

Crash when using a header #38

Open ffolkes opened 2 years ago

ffolkes commented 2 years ago

When using a header, I'm getting this crash. I'm running Android 12. The dialog opens fine once, but once dismissed and opened again, it crashes with this:

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. at android.view.ViewGroup.addViewInner(ViewGroup.java:6084) at android.view.ViewGroup.addView(ViewGroup.java:5903) at android.view.ViewGroup.addView(ViewGroup.java:5860) at com.crowdfire.cfalertdialog.CFAlertDialog.setHeaderView(CFAlertDialog.java:436) at com.crowdfire.cfalertdialog.CFAlertDialog.populateCardView(CFAlertDialog.java:232) at com.crowdfire.cfalertdialog.CFAlertDialog.createCardView(CFAlertDialog.java:162) at com.crowdfire.cfalertdialog.CFAlertDialog.setupSubviews(CFAlertDialog.java:126) at com.crowdfire.cfalertdialog.CFAlertDialog.onCreate(CFAlertDialog.java:109) at android.app.Dialog.dispatchOnCreate(Dialog.java:810) at android.app.Dialog.show(Dialog.java:453) at com.crowdfire.cfalertdialog.CFAlertDialog.show(CFAlertDialog.java:274) at com.crowdfire.cfalertdialog.CFAlertDialog$Builder.show(CFAlertDialog.java:1079)

uzman commented 1 year ago

How do you add header view?