You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an error when using the UNDERLABEL style.
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:5034) at android.view.ViewGroup.addView(ViewGroup.java:4865) at android.view.ViewGroup.addView(ViewGroup.java:4805) at com.basgeekball.awesomevalidation.utility.ViewsInfo.restoreViews(SourceFile:32) at com.basgeekball.awesomevalidation.validators.UnderlabelValidator$2.onTextChanged(SourceFile:131) at android.widget.TextView.sendOnTextChanged(TextView.java:9754) at android.widget.TextView.handleTextChanged(TextView.java:9851) at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:12509) at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1263) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:575) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:506) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:36) at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:843) at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197) at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:183) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:341) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I have 4 EditText views, two of which are using basic regex validation, and two that are using SimpleCustomValidation. My validations are run on a button click. If there has already been an underlabel added, a duplicate one gets right below. When an attempt is made to change the value in the EditText, the above exception gets thrown. I tried adding in a validation.clear() after all my validation.addValidation() calls.
It may also be worth mentioning that I am using androidx libraries. My other validations are working as intended. The only difference here is that this is on an Activity instead of a Fragment.
The text was updated successfully, but these errors were encountered:
I did check that link out. But it's talking Fragments. While I do have validation on my Fragments, this issue I discovered when I'm using an Activity instead. I have the validations set in in the onCreate method of that Activity, within my onClickListener of the button. I do not see the same issue occurring within my Fragment validations.
I encountered an error when using the UNDERLABEL style.
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:5034) at android.view.ViewGroup.addView(ViewGroup.java:4865) at android.view.ViewGroup.addView(ViewGroup.java:4805) at com.basgeekball.awesomevalidation.utility.ViewsInfo.restoreViews(SourceFile:32) at com.basgeekball.awesomevalidation.validators.UnderlabelValidator$2.onTextChanged(SourceFile:131) at android.widget.TextView.sendOnTextChanged(TextView.java:9754) at android.widget.TextView.handleTextChanged(TextView.java:9851) at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:12509) at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1263) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:575) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:506) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:36) at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:843) at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197) at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:183) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:341) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I have 4 EditText views, two of which are using basic regex validation, and two that are using SimpleCustomValidation. My validations are run on a button click. If there has already been an underlabel added, a duplicate one gets right below. When an attempt is made to change the value in the EditText, the above exception gets thrown. I tried adding in a validation.clear() after all my validation.addValidation() calls.
It may also be worth mentioning that I am using androidx libraries. My other validations are working as intended. The only difference here is that this is on an Activity instead of a Fragment.
The text was updated successfully, but these errors were encountered: