onReceivedSslError 是WebView的一个方法
解决办法,直接把下面代码粘贴到你的项目中就可以了。
//下面的方法解决Android6.0加载不出webView的问题
@Override
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {final AlertDialog.Builder builder = new AlertDialog.Builder(WechatLoginActivity.this);builder.setMessage(R.string.notification_error_ssl_cert_invalid);builder.setPositiveButton("continue", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {handler.proceed();}});builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {handler.cancel();}});final AlertDialog dialog = builder.create();dialog.show();}