您的位置:首页 > 移动开发 > Android开发

android viewp嵌套Fragment时遇到The specified child already has a parent. You must call removeView()问题的解决

2014-11-27 14:17 621 查看
<span style="font-size:18px;">@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (root == null) {
root = inflater.inflate(R.layout.fragment_pull_listview, container, false);
} else {
ViewGroup p = (ViewGroup) root.getParent();
if (p != null) {
p.removeAllViewsInLayout();
}
}
return root;
}</span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐