These two days encountered a problem, there is a page always crash error, the error message is
Process:com.eva.masterplus, pid:3536
Java.lang.IllegalArgumentException:Scrapped or attached views may is not recycled. Isscrap:false Isattached:true
Refers to the view has not been recycled, looking for a half-day, found that the Recyclerview data to clear the operation, before re-add the data to forget the notification interface to redraw, so crashes.
Workaround simply remember to add notifydatasetchanged () to the code after the clear data.
It is also found that you forgot to reset the control after the pull-up load or the drop-down refresh. Remember to add code after pull-up or pull-down
if (swipeRefreshLayout.isRefreshing()) { swipeRefreshLayout.setRefreshing(false); } else { recyclerView.onLoadMoreComplete(); }
Xrecycleview (scrapped or attached views is not being recycled)