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

来源:互联网 发布:自制手机网络接收器 编辑:程序博客网 时间:2024/05/16 12:30

解决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);
1 0
原创粉丝点击