正在刷新的状态下,reclycleview居然可以上滑
guangzq opened this issue · 1 comments
guangzq commented
正在刷新的状态下,reclycleview居然可以上滑
liyujiang-gzu commented
对,RecycleView正在刷新时上滑可能会闪退:java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 157(offset:157).state:588
解决方案,刷新时禁止滑动:
recyclerView.setOnTouchListener(new View.OnTouchListener() {
@OverRide
public boolean onTouch(View v, MotionEvent event) {
return swipeToLoadLayout.isRefreshing();
}
});