Fragment+FragmentActivity出现The specified child already has a parent. You must call removeView() on the child's parent first.

这个异常是出现在Fragment中的onCreateView方法中初始化布局时发生的。

View view = inflater.inflate(R.layout.fragment3_layout, container);

将上面的那段代码稍微修改一下此异常就解决了。

View view = inflater.inflate(R.layout.fragment3_layout, container,false);

 

posted on 2014-05-30 17:29  飘杨......  阅读(1295)  评论(0编辑  收藏  举报