CymChad / CymChad/BaseRecyclerViewAdapterHelper

通过继承的方式传递布局报java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType

Open
#3,366 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
24.6k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

image image 使用这种继承的方式 传值 报 java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType at com.chad.library.adapter.base.BaseQuickAdapter.createBaseViewHolder(BaseQuickAdapter.java:694) at com.chad.library.adapter.base.BaseQuickAdapter.onCreateViewHolder(BaseQuickAdapter.java:546)

请问 有没有人解决过这个问题

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at BaseQuickAdapter.java:694 and trace the inherited layout path that reaches createBaseViewHolder, then compare it with the call from onCreateViewHolder at line 546. Reproduce the reported ClassCastException using the inheritance pattern shown in the issue; done means inherited layout passing no longer throws that exception and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.