The specified child already has a parent. You must call removeView() on the child's parent first
2015-03-26 09:34
471 查看
学习android 的 fragment时遇到The specified child already has a parent. You must call removeView() on the child's parent first的错误,
提示已经有父容器,通过调试一直是fragmentTransaction.commit();的错误,后来知道是fragment中的问题
View view = inflater.inflate(R.layout.activity_content, container);
原来这里默认绑定了一个container的容器,所以调用commit时提示已经有了父容器,只需改成
View view = inflater.inflate(R.layout.activity_content, container, false);
默认不绑定就可以了
提示已经有父容器,通过调试一直是fragmentTransaction.commit();的错误,后来知道是fragment中的问题
View view = inflater.inflate(R.layout.activity_content, container);
原来这里默认绑定了一个container的容器,所以调用commit时提示已经有了父容器,只需改成
View view = inflater.inflate(R.layout.activity_content, container, false);
默认不绑定就可以了
相关文章推荐
- The specified child already has a parent. You must call removeView() on the child's parent first问题
- The specified child already has a parent. You must call removeView() on the child's parent first.;
- 二、The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first
- The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first
- [已]The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent.You must call removeView() on the child's parent first问题
- The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first.
- The specified child already has a parent. You must call removeView() on the child's parent first.问解决
- The specified child already has a parent. You must call removeView() on the child's parent first
- The specified child already has a parent. You must call removeView() on the child's parent first.
- 一、he specified child already has a parent. You must call removeView() on the child's parent first.
- BUG:The specified child already has a parent. You must call removeView() on the child's parent first
- The specified child already has a parent. You must call removeView() on the child's parent first,
- The specified child already has a parent. You must call removeView() on the child's parent first.