显示错误
@Override
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
}
我创建了一个警告对话框,代码如下:-
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setMessage("SSL Certificate Error" + "n" + "Do you want to continue anyway?");
builder.setPositiveButton("Continue", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
handler.proceed();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
handler.cancel();
}
});
final AlertDialog dialog = builder.create();
dialog.setTitle("Alert");
dialog.show();
但是在对话框handler.cancel()的取消按钮上;不起作用。
调用handler.cancel();谁能帮帮我
你试过这个吗?webview.stopLoading();
我也有同样的问题,但它在我的情况下工作。