加载" https"在android web视图中的url,获取连接超时错误

时间:2016-02-26 09:07:57

标签: android-webview webviewclient

当我尝试加载https网址时,会产生一个空白页面。我在webviewclient中覆盖了onReceivedSslError方法,但是这个覆盖的方法永远不会执行。另外我覆盖了onReceivedError方法,其中我将CONNECTION_TIMED_OUT作为错误描述参数。

@Override
    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
        super.onReceivedSslError(view, handler, error);
        handler.proceed(); 
    }

@Override
    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
        // TODO Auto-generated method stub
        super.onReceivedError(view, errorCode, description, failingUrl);
        Toast.makeText(getApplicationContext(), description, 200).show();
    }

0 个答案:

没有答案