您的位置:首页 > 理论基础 > 计算机网络

解决android 5.0 webview不能加载http与https混合内容的问题

2016-10-20 17:23 1121 查看
解决webview白屏问题

The page at 'https://lab.chinapnr.com/muser/publicRequests' was loaded over HTTPS,
but is submitting data to an insecure location at 'http://XXXX/A4/chinapnrhandle/deposit.html':
this content should also be submitted over HTTPS.
", source: https://lab.chinapnr.com/muser/publicRequests (1)


其中XXXX是域名,地址,不方便公开, 大概意思就是 A地址是通过Https方式加载的, 但是在提交数据的时候,却提交到了一个不安全的地址B,http格式的,所以,它要求B地址也通过https加载

解决方式,设置https和http两种模式混合加载,只要在设置webview的时候,加上下面这句话

setting.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  webview