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

BaseMultiItemQuickAdapter [bug] #2393

Closed
JarvisBuop opened this issue Aug 10, 2018 · 2 comments
Closed

BaseMultiItemQuickAdapter [bug] #2393

JarvisBuop opened this issue Aug 10, 2018 · 2 comments

Comments

@JarvisBuop
Copy link

JarvisBuop commented Aug 10, 2018

使用BaseMultiItemQuickAdapter 时,自己继承的viewholder是内部类时会发生RecyclerViewholder反射造类失败,导致所有的convert方法不运行;

class ContentHolder extends RecyclerViewHolder<BaseQuickAdapter, BaseViewHolder, Object> 

ps:使用静态内部类没毛病,反射那块有问题

Class<? extends RecyclerViewHolder> cls = holderClasses.get(viewType);
                Constructor c = cls.getDeclaredConstructors()[0]; // 第一个显式的构造函数
                c.setAccessible(true);
                h = (RecyclerViewHolder) c.newInstance(new Object[]{this});
                multiTypeViewHolders.get(viewType).put(key, h);
@JarvisBuop JarvisBuop changed the title BaseMultiItemQuickAdapter BaseMultiItemQuickAdapter [bug] Aug 10, 2018
@CymChad
Copy link
Owner

CymChad commented Jul 13, 2019

收到

@shichaohui
Copy link
Collaborator

未复现该问题,若您仍遇到该问题,请按照 #2807 重新提交 Issue 。

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

3 participants