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

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter position BannerImageHolder{42a3d21 position=0 id=-1, oldPos=-1, pLpos:-1 no parent} #1103

Closed
KevinSgun opened this issue Nov 19, 2021 · 3 comments

Comments

@KevinSgun
Copy link

程序运行一段时间后就报错crash了,这个错误,怎么处理
Process: com.xincheng1.chat, PID: 19664
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionBannerImageHolder{42a3d21 position=0 id=-1, oldPos=-1, pLpos:-1 no parent} androidx.viewpager2.widget.ViewPager2$RecyclerViewImpl{9239ab8 VFED..... ......ID 0,0-1080,255 #5}, adapter:com.xincheng1.chat.ui.anchor.adapter.AnchorListAdapter$HeaderHold$1@f9d2091, layout:com.youth.banner.util.ScrollSpeedManger@6f93bf6, context:com.xincheng1.chat.ui.MainActivity@45dfd80
at androidx.recyclerview.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:6156)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6339)
at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6517)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

@zhidaoshijiejintou
Copy link

我也遇到同样的问题解决了吗

@mayer500
Copy link

mayer500 commented Jul 4, 2022

这问题有没有不需要下载源码修改的方法去处理的

@pengxiyang
Copy link

#1195 (comment)

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

5 participants