java.lang.IndexOutOfBoundsException
lowfiend opened this issue · comments
Hello
I got this error and found a page to explain this error.
But I don't know how to fix this error.
plz help me
`java.lang.IndexOutOfBoundsException
Inconsistency detected. Invalid item position 35(offset:35).state:36
android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4041)
android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3999)
android.support.v7.widget.LayoutState.next(LayoutState.java:83)
android.support.v7.widget.StaggeredGridLayoutManager.fill(StaggeredGridLayoutManager.java:1412)
android.support.v7.widget.StaggeredGridLayoutManager.scrollBy(StaggeredGridLayoutManager.java:1878)
android.support.v7.widget.StaggeredGridLayoutManager.scrollVerticallyBy(StaggeredGridLayoutManager.java:1796)
android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1204)
android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:1951)
android.view.View.dispatchTouchEvent(View.java:8497)`
I found the bug in this issue.
I use StaggeredGridLayoutManager & setCustomLoadMoreView.
I disableLoadMore use three funtion :
- ultimateRecyclerView.disableLoadmore()
- ultimateViewAdapter.enableLoadMore(false)
- ultimateViewAdapter.internalExecuteLoadingView()
It would cause java.lang.IndexOutOfBoundsException error.
step:
Very slow scorlling, it will happen.
If you setLayoutManager is LinearLayoutManager, it works good not crash.
plz fix this bug, thank u.