学习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);
默认不绑定就可以了