我有一个用于加载网址的 webview
,但是它不起作用。
看看我的代码:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView wv = (WebView) findViewById(R.id.webView);
//Log.d("rudyy", "aqui");
wv.loadUrl("https://tripulanteaims.tam.com.br/wtouch/wtouch.exe/index");
//Log.d("rudyy", "fim");
}
}
执行此代码时,Android 返回以下错误:
Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
请帮我一下。
@Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error){ handler.proceed(); } });
将上述代码添加到您的Android应用程序中,以便在加载网页时忽略SSL错误。 - tyoc213