Android webView 5.0 不允许混合模式,https中不能加载http的资源
会报错
This request has been blocked; the content must be served over HTTPS
解决方案
//解决加载不了http图片的问题
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
webView.getSettings().setBlockNetworkImage(false);
网友评论