当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
MySQL笔记3_约束_主键约束
MySQL notes 4_ Primary key auto_increment
C#新大陆物联网云平台的连接(简易理解版)
MySQL笔记1_数据库
launcher隐藏不需要显示的app icon
【2021年新书推荐】Practical Node-RED Programming
Abnormal record-17
iTOP4412 FramebufferNativeWindow(4.0.3_r1)
【2021年新书推荐】Kubernetes in Production Best Practices
Itop4412 HDMI display (4.0.3_r1)
this. getOptions is not a function
【2021年新书推荐】Practical IoT Hacking
Itop4412 kernel restarts repeatedly
Recyclerview 批量更新View:notifyItemRangeInserted、notifyItemRangeRemoved、notifyItemRangeChanged
Markdown basic grammar notes
【2021年新书推荐】Effortless App Development with Oracle Visual Builder
npm ERR code 500解决
发布自定义插件到本地服务器
adb shell top 命令详解
Cause: dx. jar is missing