BaseRecyclerViewAdapterHelper
BaseRecyclerViewAdapterHelper copied to clipboard
BaseRecyclerViewAdapterHelper 使用 RecyclerView1.2.0 会出现java.lang.IllegalArgumentException
- 当前使用的版本号 3.0.4 使用 RecyclerView1.2.0
- 复现操作描述
- 使用代码
- crash日志
1 | java.lang.IllegalArgumentException: Called attach on a child which is not detached: BaseViewHolder |
---|---|
at androidx.recyclerview.widget.RecyclerView$5.attachViewToParent(SourceFile:4) |
at androidx.recyclerview.widget.ChildHelper.attachViewToParent(SourceFile:5)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(SourceFile:20)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(SourceFile:2)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(SourceFile:1)
at com.google.android.flexbox.FlexboxLayoutManager.layoutFlexLineMainAxisHorizontal(SourceFile:25)
at com.google.android.flexbox.FlexboxLayoutManager.layoutFlexLine(SourceFile:2)
at com.google.android.flexbox.FlexboxLayoutManager.fill(SourceFile:12)
at com.google.android.flexbox.FlexboxLayoutManager.onLayoutChildren(SourceFile:23)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(SourceFile:12)
at androidx.recyclerview.widget.RecyclerView.onMeasure(SourceFile:13)
你找到原因了吗?我也遇到这个问题了