Answers for "}:Java.Lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first."

3

The specified child already has a parent. You must call removeView() on the child's parent first

// TEXTVIEW
if(tv.getParent() != null) {
    ((ViewGroup)tv.getParent()).removeView(tv); // <- fix
}
layout.addView(tv); //  <==========  ERROR IN THIS LINE DURING 2ND RUN
// EDITTEXT
Posted by: Guest on April-28-2020

Code answers related to "}:Java.Lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language