当前位置:网站首页>WebView displays a blank due to a certificate problem
WebView displays a blank due to a certificate problem
2022-04-23 07:12:00 【Drink dichlorvos alone】
Problem phenomenon
webview A blank , And all kinds of browsers can access this url. However, it will prompt the problem that the certificate is unsafe
Solutions
Because whether it's mobile access , Or browser access , Will prompt the certificate problem , and
webview There is one setWebViewClient(new MyWebViewCliecnt()) Method , When webview When there is a certificate problem with the loaded web page , It's going to come back MyWebViewCliecnt Of
@Override
public void onReceivedSslError(final WebView view, final SslErrorHandler handler, SslError error) {
}
Method . At the same time, it will be executed by default handler.cancel() Method , Pictured

WebViewClient After calling the above SslErrorHandler Of cancel After method , Will call back soon onPageFinished Method , No callback onReceivedError , Therefore, the custom loading error page will not be displayed , The result is a blank .
And what we have to do , Is to rewrite onReceivedSslError Method , And implement handler.proceed(), Indicates that if the certificate is incorrect , Or choose to enter the web page
Pictured

So you can get into .
版权声明
本文为[Drink dichlorvos alone]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230606380206.html
边栏推荐
猜你喜欢

实习做了啥

【2021年新书推荐】Red Hat Certified Engineer (RHCE) Study Guide

【2021年新书推荐】Effortless App Development with Oracle Visual Builder

常用UI控件简写名

一款png生成webp,gif, apng,同时支持webp,gif, apng转化的工具iSparta

Information:2021/9/29 10:01 - Build completed with 1 error and 0 warnings in 11s 30ms Error异常处理

C#新大陆物联网云平台的连接(简易理解版)

Bottom navigation bar based on bottomnavigationview

开篇:双指针仪表盘的识别

./gradlew: Permission denied
随机推荐
AVD Pixel_ 2_ API_ 24 is already running. If that is not the case, delete the files at C:\Users\admi
Abnormal record-15
接口幂等性问题
Exception record-14
[SM8150][Pixel4]LCD驱动
个人学习相关
Oracle Job定时任务的使用详解
MarkDown基础语法笔记
Abnormal record-20
统一任务分发调度执行框架
C#新大陆物联网云平台的连接(简易理解版)
mysql和pg库遇到冲突数据时的两种处理方式
oracle分区的相关操作
ThreadLocal,看我就够了!
取消远程依赖,用本地依赖
ViewPager2实现画廊效果执行notifyDataSetChanged后PageTransformer显示异常 界面变形问题
谷歌AdMob广告学习
Abnormal record-12
几款电纸书阅读器参数对比
組件化學習