您的位置:首页 > 其它

the specified child already has a parent. you must call removeview() 的解决方法

2014-08-09 20:08 525 查看
在Android4.0api以上版本中, 当viewpager.set继承FragmentStatePagerAdapter的adapter时有时会返回java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.解决方法是:

在viewpager的item fragment中的oncreateView方法中,使用inflater.inflate(view, null), 不要使用inflater.inflate(view, container)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐