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

findViewById 返回的对象不兼容泛型写法 #176

Open
anyanmolong opened this issue Jan 8, 2019 · 1 comment
Open

findViewById 返回的对象不兼容泛型写法 #176

anyanmolong opened this issue Jan 8, 2019 · 1 comment

Comments

@anyanmolong
Copy link

findViewById 返回的对象不兼容泛型写法, 26以上项目findViewById没有写强转的就接入这项目就会报错, 然后发现没有兼容API26的泛型findViewById方法

@toutoumu
Copy link

toutoumu commented Jan 11, 2019

几年前发现这个问题, 自己下载源码解决了
@OverRide
public View findViewById(int id) {
View v = super.findViewById(id);
if (v == null && mHelper != null)
return mHelper.findViewById(id);
return v;
}

@OverRide public T findViewById(int id) {
T v = super.findViewById(id);
if (v == null && mHelper != null) return mHelper.findViewById(id);
return v;
}

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

2 participants