机器人的WebView不加载HTTPS URL机器人、加载、URL、WebView

2023-09-12 21:45:20 作者:Confession

public void onCreate(Bundle savedInstance)
{       super.onCreate(savedInstance);
    setContentView(R.layout.show_voucher);
        webView=(WebView)findViewById(R.id.webview);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setBuiltInZoomControls(true);
        String url ="https://www.paymeon.com/Vouchers/?v=%C80%8D%B1x%D9%CFqh%FA%84%C35%0A%1F%CE&iv=%25%EE%BEi%F4%DAT%E1"
        //webView.loadUrl(url); // Not Working... Showing blank
        webView.loadUrl("http://www.yahoo.com"); // its working

}

在尝试加载URL中的WebView ..不加载显示空白屏幕。如果我加载谷歌或雅虎其工作正常。

When try to load url in webview .. not loading showing blank screen . if i load google or yahoo its working fine..

推荐答案

请访问此链接:

添加这种压倒一切的方法,你WebViewClient实现。你需要与Android SDK 2.2(API 8级)或更高版本的编译。该方法出现在公众的SDK 2.2(API级别8),但我们已经在运行2.1,1.6和1.5的设备测试,它工作在这些设备太(如此明显的行为一直存在的所有沿)。

Add this overriding method to your WebViewClient implementation. You'll need to compile it with Android SDK 2.2 (API level 8) or later. The method appears in the public SDK as of 2.2 (API level 8) but we've tested it on devices running 2.1, 1.6 and 1.5 and it works on those devices too (so obviously the behaviour has been there all along).

 @Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    handler.proceed(); // Ignore SSL certificate errors
}

这将帮助你。