重载WebViewClient函数:
class MyWebViewClient extends WebViewClient {
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.proceed(); // Ignore SSL certificate errors
}
}
...
mWebView.setWebViewClient(new MyWebViewClient());
...