IllegalStateException: The specified child already has a parent.

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

做了一个加载动画首页

IllegalStateException: The specified child already has a parent.

加载和刷新头部

IllegalStateException: The specified child already has a parent.

IllegalStateException: The specified child already has a parent.

但在fragment切换时,这两个地方报错

IllegalStateException: The specified child already has a parent.

 参考网上方法,没找到一样的,但根据报错推断都时一样的错,一样找出child's parent删除掉多出的View
IllegalStateException: The specified child already has a parent.

搞定,没有报错了