Scrapped or attached views may not be recycled
来源:互联网 发布:手机淘宝推广 编辑:程序博客网 时间:2024/05/13 00:06
这两天遇到一个问题,有个页面总是崩溃出错,错误提示是
Process: com.eva.masterplus, PID: 3536
java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true
是指view没有被recycled,找了半天,发现recyclerView的数据进行清空操作之后,在重新添加数据之前忘记了通知界面进行重新绘制,所以崩溃。
解决方法只要在clear数据之后代码中记得加notifyDataSetChanged() 即可。
还发现一种情况是在上拉加载更多或者下拉刷新之后忘记使控件重置了。要记得上拉或者下拉之后加上代码
if (swipeRefreshLayout.isRefreshing()) { swipeRefreshLayout.setRefreshing(false); } else { recyclerView.onLoadMoreComplete(); }
2 0
- Scrapped or attached views may not be recycled
- Scrapped or attached views may not be recycled
- Scrapped or attached views may not be recycled
- RecyclerView 报Scrapped or attached views may not be recycled. as Scrap:false isAttached:true异常
- java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false is
- java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false is
- Scrapped or attached views may not be recycled. isScrap:false isAttached:true错误
- java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false is
- IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:t
- java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false is
- java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false is
- Scrapped or attached views may not be recycled. isScrap:false isAttached:true异常
- will not be exported or published. Runtime ClassNotFoundExceptions may result
- SharePoint 2013 删除母版页报错“This file may not be moved, deleted, renamed, or otherwise edited”
- This function or variable may be unsafe
- The configuration may be corrupt or incomplete
- This function or variable may be unsafe
- This function or variable may be unsafe
- 数据结构与算法:查找
- Struts2+spring+hibernate的配置文件配置
- 隐藏单元(四)
- Java虚拟机体系结构
- 在Linux下配置环境变量
- Scrapped or attached views may not be recycled
- 二十个常用的正则表达式,你值得拥有
- 链表 C http://blog.csdn.net/pf4919501/article/details/38818335
- css3文本属性text-shadow
- House Robber II
- linux用源码安装mysql的时候编译报错的解决方法
- APP版本更新时,Archive成功但是构建版本里面不显示
- ListView隔行变色
- Android通用网络请求解析框架.1(需求,思想)