我在 RecyclerView 里面做了 RecyclerView。有ClassCastException在 onBindViewHolder。
错误信息在这里。
java.lang.ClassCastException: com.work.hany.playinseoul.main.adapter.MainRecyclerViewAdapter$TourViewHolder$TourSectionItemsAdapter$TourItemViewHolder cannot be cast to com.work.hany.playinseoul.main.adapter.MainRecyclerViewAdapter$CategoryViewHolder$CategoryItemViewHolder
at com.work.hany.playinseoul.main.adapter.MainRecyclerViewAdapter$CategoryViewHolder$CategoryHorizontalAdapter.onBindViewHolder(MainRecyclerViewAdapter.java:216)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6673)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6714)
但我无法赶上ClassCastException的TourSectionItemsAdapter onBindViewHolder。因此,我无法在 TourSectionItemsAdapter onBindViewHolder 上检查持有人类型。
只有我在 MainRecyclerViewAdapter onBindViewHolder 上捕获了 ClassCastException。但是 MainRecyclerViewAdapter onBindViewHolder 持有人类型是相同的投 hodler 类。检查屏幕截图。
慕侠2389804
相关分类