1、java.lang.IllegalStateException The specified child already has a parent. You must call removeView() on the child's parent first.  

在自定义Fragment的时候,在使用下面代码来创建View的时候,出现的异常

LayoutInflater.from(Context).inflate(R.layout.xxx,viewGroup)

 需要改成

LayoutInflater.from(Context).inflate(R.layout.xxx,viewGroup,false)

 

 



posted on 2017-11-25 14:31  DOUBLEYOU  阅读(166)  评论(0)    收藏  举报