java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
2017-11-24 16:52
627 查看
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child’
这个异常是在Fragment内嵌套TabLayout+ViewPager+Fragment的时候出现的。Tab数量:4个。前三个[Tab]可以随意滑动,可是滑动到第四个再滑到前三个任意一个的时候就出现了异常:java.lang.**IllegalStateException**: The specified child already has a parent. You must call removeView() on the child'
也是搜了很多网页查找解决办法,说是子View只能有一个父View。。。花了很多时间也没好。。。
最后我是猜测——前三个没事,就最后一个有问题,就把ViewPager设置缓存个
数`
setOffscreenPageLimit(3);
成功。暂时解决。。。以后有坑再更。
相关文章推荐
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView
- java.lang.IllegalStateException The specified child already has a parent. You must call removeView()
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView
- java.lang.IllegalStateException The specified child already has a parent. You must call removeView()
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- ava.lang.IllegalStateException The specified child already has a parent. You must call removeView()
- ava.lang.IllegalStateException: The specified child already has a parent. You must call removeView()
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView(
- java.lang.IllegalStateException: The specified child already has a parent. You must call removeView
- 对话框子视图Android自定义Dialog二次调用报错解决方法:The specified child already has a parent. You must call removeView()-java教程
- Android—java.lang.IllegalStateException: The specified child already has a parent. You must call rem
- 替换Fragment 报错 The specified child already has a parent. You must call removeView() on the child's parent first.
- 二、The specified child already has a parent. You must call removeView() on the child's parent first.