webView = findViewById(R.id.webview);
webView.loadUrl("https://www.baidu.com");
webView.setWebViewClient(new WebViewClient(){
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.proceed();
super.onReceivedSslError(view, handler, error);
Log.d("TAG", "onReceivedSslError: "); //如果是证书问题,会打印出此条log到console
}
});
webView.requestFocus();
<uses-permission android:name="android.permission.INTERNET"/>
android:usesCleartextTraffic="true"