The specified child already has a parent. You must call removeView() on the child's parent first.

原创 2015年11月17日 16:20:24

在使用Fragment时,出现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.fragment_document_file, container);

最直接的改正方法:

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


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

问题:The specified child already has a parent. You must call removeView() on the child's parent first.

Dialog中使用自定义view报错。第一次点击弹出对话框按钮没有问题,第二次点击则会报错: AndroidRuntime: FATAL EXCEPTION: main Process: com....

The specified child already has a parent. You must call removeView() on the child's parent first.

代码如下: Resources res = getResources(); // Resource object to get Drawables     TabHost tabHost =...

The specified child already has a parent.You must call removeView() on the child's parent first问题

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

Fragment使用时出现错误:he specified child already has a parent. You must call removeView() on the child's p

今天学习了Fragment的用法,了解它的基本原理和生命周期,以及常用方法。可是在动态向Activity中加入Fragment或替换Fragment时总是出现如下错误: 在网上找了很久的资料...
  • k46023
  • k46023
  • 2013年11月05日 22:38
  • 1535

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

预备知识 嵌套Tab在Android应用中用途广泛,之前做过的一些东西都是运用了TabActivity。但是由于在Android Developers中说到了“TabActivity...

关于异常“The specified child already has a parent. You must call removeView"的解决

在android开发过程中,有时会在不同情况下遇到同种问题: [java] view plaincopyprint? java.lang.IllegalStateExcepti...

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

在android开发过程中,有时会在不同情况下遇到同种问题: [java] view plaincopyprint? java.lang.IllegalStateExcepti...

关于异常“The specified child already has a parent. You must call removeView"的解决(举例说明,附源码)

在android开发过程中,有时会在不同情况下遇到同种问题: java.lang.IllegalStateException The specified child already has a p...

You must call removeView() on the child's parent first错误!

在切换Fragement的时候出现:错误信息java.lang.IllegalStateException: The specified child already has a parent. You...

Android PopupWindow You must call removeView() on the child's parent first.

package com.mcdull.picker.ui; import android.app.Activity; import android.content.Intent; import an...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:The specified child already has a parent. You must call removeView() on the child's parent first.
举报原因:
原因补充:

(最多只允许输入30个字)