您的位置:首页 > 编程语言 > Java开发

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

2015-05-22 16:33 519 查看
转载:http://www.cnblogs.com/over140/archive/2013/06/06/3121354.html

信息补充:

使用FragmentActvitiy + Fragment



错误原因:

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View v = inflater.inflate(R.layout.preference_fragment, container);



解决办法:

View v = inflater.inflate(R.layout.preference_fragment,
container,
false);



补充信息:

导致此错误并不一定就是这个原因,大家也能搜到很多其他的原因,这里备注一下。

之前使用ActionBar里面的Fragment好像是可以的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐