首页 > 代码库 > java.lang.IllegalStateException: The specified child already has a parent. You must call removeView

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView

??

java.lang.IllegalStateException:

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

在android代码中假设出现此异常,说明在同一个布局中加入了同样的组件实例。应该创建不同的实例组件,并将其加入到布局其中。

java.lang.IllegalStateException: The specified child already has a parent. You must call removeView