Closed SheepYang1993 closed 8 years ago
ok,这个我一会看一下
这个问题解决了,RecyclerView Bug:IndexOutOfBoundsException: Inconsistency detected. Invalid item position,解决方法参考了 @drakeet 大神的解决方法,用一个标志位去判断,正在刷新数据的话就拦截掉RecycleView的touch事件,目前还没找到更好的解决方案了。 https://drakeet.me/recyclerview-bug-indexoutofboundsexception-inconsistency-detected-invalid-item-position-solution
private void setRecycleScrollBug() {
mRecyclerView.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
if (mIsRefreshing)
{
return true;
} else
{
return false;
}
}
});
}
下拉刷新后立即上滑会报错