android 5.1 系统 webview 控件崩溃 日志:
查找原因,分析发现崩溃发生在Android版本21和22上
1.在android O上遇到这种webView渲染异常,那就在manifest的Application下面添加:
<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="true"/>
2、自定义重写webview :
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.util.AttributeSet;
import android.webkit.WebView;
public class CustomWebView extends WebView {
public CustomWebView(Context context) {
super(getFixedContext(context));
}
public CustomWebView(Context context, AttributeSet attrs) {
super(getFixedContext(context), attrs);
}
public CustomWebView(Context context, AttributeSet attrs,