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

越界错误 #66

Closed
Ivolian opened this issue May 20, 2017 · 3 comments
Closed

越界错误 #66

Ivolian opened this issue May 20, 2017 · 3 comments

Comments

@Ivolian
Copy link

Ivolian commented May 20, 2017

java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.get(ArrayList.java:413)
at me.yokeyword.indexablerv.IndexableLayout$5.onScrolled(IndexableLayout.java:399)
at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4618)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3679)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3323)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844)

IndexableLayout.this.mIndexBar.setSelection(firstItemPosition);
if(IndexableLayout.this.mSticyEnable) {
ArrayList list = IndexableLayout.this.mRealAdapter.getItems();
if(IndexableLayout.this.mStickyViewHolder != null && list.size() > firstItemPosition) {
EntityWrapper wrapper = (EntityWrapper)list.get(firstItemPosition);

当 indexableAdapter setDatas 为空 list 时, firstItemPosition 就返回 -1 了。

@proud2008
Copy link

也遇到了这个问题 ,期待解决呀

@proud2008
Copy link

image

@YoKeyword
Copy link
Owner

v1.2.4已Fix 🍺 :)

YoKeyword added a commit that referenced this issue Jul 5, 2017
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

3 participants