SimpleNews icon indicating copy to clipboard operation
SimpleNews copied to clipboard

角标越界

Open nicelyjust opened this issue 8 years ago • 2 comments

滑动新闻列表头条,按住上下滑动时,报错了 10-12 17:39:55.368 13164-13164/com.lauren.simplenews E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lauren.simplenews, PID: 13164 java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 7(offset:7).state:51 at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4405) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4363)

nicelyjust avatar Oct 12 '16 09:10 nicelyjust

我也遇到了同样的问题 在新闻列表模块,下拉刷新,在刷新还未结束时,迅速向上滑动便会出现这个问题。 java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionViewHolder{2e4d603c position=1 id=-1, oldPos=-1, pLpos:-1 no parent}

我自己做项目时,也遇到了同样的问题,还未解决,期待作者可以解决一下。

tonycheng93 avatar Oct 19 '16 06:10 tonycheng93

找到出问题位置了:

 @Override
    public void onRefresh() {
        pageIndex = 0;
//        if(mData != null) {
//            mData.clear();
//        }
        mNewsPresenter.loadNews(mType, pageIndex);
    }

把注释的代码去掉,就不会Crash了

tonycheng93 avatar Oct 19 '16 07:10 tonycheng93