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

4.1.4最新版本onItemViewType position 下标越界 #3874

Open
CFSB opened this issue Jul 8, 2024 · 0 comments
Open

4.1.4最新版本onItemViewType position 下标越界 #3874

CFSB opened this issue Jul 8, 2024 · 0 comments

Comments

@CFSB
Copy link

CFSB commented Jul 8, 2024

我有列表里十几条数据,onItemViewType的position每次执行到第四次是position变成-1,之前3次都是0

a7c5060ce786b4a840bd2adb9e20eda6
java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at com.yigequanquanqq.app.ui.adapter.TTWorldCircleAdapter.getItemViewType(TTWorldCircleAdapter.kt:178)
at com.chad.library.adapter4.BaseQuickAdapter.getItemViewType(BaseQuickAdapter.kt:228)
at com.chad.library.adapter4.BaseQuickAdapter.onViewAttachedToWindow(BaseQuickAdapter.kt:284)
at com.chad.library.adapter4.BaseMultiItemAdapter.onViewAttachedToWindow(BaseMultiItemAdapter.kt:80)
at com.yigequanquanqq.widget.layout.WrapRecyclerView$WrapRecyclerAdapter.onViewAttachedToWindow(WrapRecyclerView.kt:297)
at androidx.recyclerview.widget.RecyclerView.dispatchChildAttached(RecyclerView.java:8377)
at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:954)
at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:131)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:9430)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:9388)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:9375)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1676)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:687)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4645)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4348)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4919)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at com.scwang.smart.refresh.layout.SmartRefreshLayout.onLayout(SmartRefreshLayout.java:649)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1762)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:868)
at android.view.View.layout(View.java:23563)
at android.view.ViewGroup.layout(ViewGroup.java:6452)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3851)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3301)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2265)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9025)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1142)
at android.view.Choreographer.doCallbacks(Choreographer.java:946)
2024-07-08 19:15:23.166 20976-20976 AndroidRuntime com.yigequanquanqq.app E at android.view.Choreographer.doFrame(Choreographer.java:875)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1127)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)

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

1 participant