Open anyanmolong opened 5 years ago
findViewById 返回的对象不兼容泛型写法, 26以上项目findViewById没有写强转的就接入这项目就会报错, 然后发现没有兼容API26的泛型findViewById方法
几年前发现这个问题, 自己下载源码解决了 @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; }
findViewById 返回的对象不兼容泛型写法, 26以上项目findViewById没有写强转的就接入这项目就会报错, 然后发现没有兼容API26的泛型findViewById方法