当前位置:网站首页>webView因证书问题显示一片空白
webView因证书问题显示一片空白
2022-04-23 06:07:00 【独饮敌敌畏丶】
问题现象
webview
一片空白,而各种浏览器都可以访问此url。但是会提示证书不安全的问题
解决思路
因为不管是手机访问,还是浏览器访问,都会提示证书问题,而
webview
有一个setWebViewClient(new MyWebViewCliecnt())
方法,当webview
加载的网页出现证书问题的时候,就会回调MyWebViewCliecnt
的
@Override
public void onReceivedSslError(final WebView view, final SslErrorHandler handler, SslError error) {
}
方法。同时会默认执行handler.cancel()
方法,如图
WebViewClient
在调用了上面的 SslErrorHandler
的 cancel
方法以后,就马上会回调 onPageFinished
方法,不会回调 onReceivedError
,所以也就不会展示自定义的加载错误页面,结果就是一片空白了。
而我们要做的,就是重写onReceivedSslError
方法,并执行handler.proceed()
,表示如果证书不对,还是选择进入网页
如图
这样就可以进入了。
版权声明
本文为[独饮敌敌畏丶]所创,转载请带上原文链接,感谢
https://blog.csdn.net/afdafvdaa/article/details/122085373
边栏推荐
- 一个DG环境的ORA-16047: DGID mismatch between destination setting and target database问题排查及监听VNCR特性
- Apache SeaTunnel 2.1.0部署及踩坑
- Apprentissage par composantes
- Tiny4412 HDMI显示
- Exception record-5
- Prometheus monitoring method and index interpretation of influxdb
- Abnormal record-11
- Oracle redo log产生量大的查找思路与案例
- Django::Did you install mysqlclient?
- Ali vector library Icon tutorial (online, download)
猜你喜欢
冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影
JVM basics you should know
Chaos帶你快速上手混沌工程
Prometheus cortex Architecture Overview (horizontally scalable, highly available, multi tenant, long-term storage)
10g数据库使用大内存主机时不能启动的问题
Practice using polardb and ECs to build portal websites
Problems related to Prometheus cortex using block storage
Winter combat camp hands-on combat - first understand the cloud foundation, hands-on practice ECS ECS ECS novice on the road to get the mouse cloud Xiaobao backpack shadowless
Try catch cannot catch asynchronous errors
ACFS文件系统创建扩大缩小等配置步骤
随机推荐
oracle表空间表分区详解及oracle表分区查询使用方法
oracle杀死正在执行的sql
Problems related to Prometheus cortex using block storage
switch case时连写常规判断表达式的错误 case和if并用 l
实践使用PolarDB和ECS搭建门户网站
oracle 修改默认临时表空间
oracle给对象重命名
Construire un blog Cloud basé sur ECS (bénédiction sur le Code Cloud Xiaobao, explication détaillée de la tâche iphone13 gratuite)
从0开始封装一套项目的网络请求框架
Exception record-8
How does thanos configure different data retention durations for different tenants
Prometheus monitoring method and index interpretation of influxdb
Kubernetes coredns FAQ reference
Prometheus alarm record persistence (historical alarm saving and Statistics)
iTOP4412 HDMI显示(4.4.4_r1)
Error alarm of Postgres master-slave replication delay monitoring
Comparison between Prometheus thanos and cortex components
Dolphinscheduler源码包src.tar.gz解压问题
Abnormal record-10
JVM basics you should know