请教一下关于三方WebView在inflate的时候出现的强转错误
Iridescentangle opened this issue · 2 comments
Iridescentangle commented
如图所示,使用了基于腾讯X5WebView的YCWebView 链接https://github.com/yangchong211/YCWebView
但在inflate过程中会报错,Scene cannot cast to Activity...
求解,有什么好办法...
qii commented
abstract class ActivityContextGroupScene extends UserVisibleHintGroupScene {
@Override
protected final LayoutInflater onGetLayoutInflater() {
return requireActivity().getLayoutInflater();
}
}
abstract class ActivityContextScene extends Scene {
@Override
protected final LayoutInflater onGetLayoutInflater() {
return requireActivity().getLayoutInflater();
}
}
你的 Scene 改为继承这个
Iridescentangle commented
abstract class ActivityContextScene extends Scene { @Override protected final LayoutInflater onGetLayoutInflater() { return requireActivity().getLayoutInflater(); } }
好的,非常感谢!!!