Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

角标越界 #23

Open
nicelyjust opened this issue Oct 12, 2016 · 2 comments
Open

角标越界 #23

nicelyjust opened this issue Oct 12, 2016 · 2 comments

Comments

@nicelyjust
Copy link

滑动新闻列表头条,按住上下滑动时,报错了
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)

@tonycheng93
Copy link

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

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

@tonycheng93
Copy link

找到出问题位置了:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants