添加 onReceivedSslError 时找不到符号错误 [英] cannot find symbol error when adding onReceivedSslError
本文介绍了添加 onReceivedSslError 时找不到符号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个java类
public class MyWebViewClient extends WebViewClient
{
private MyUIWebView webView;
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
{
super.onReceivedError(view, errorCode, description, failingUrl);
}
这编译得很好.我也想添加 SSL 错误处理,所以我添加
This compiles well.to which I want to add SSL error handling too, so I add
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.proceed();
}
但这会产生编译错误
build:
[javac] Compiling 1 source file to /Users/admin/Documents/Mine
[javac] /Users/admin/Documents/MyWebViewClient.java:62: cannot find symbol
[javac] symbol : class SslErrorHandler
[javac] public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
[javac]
我已经为这门课准备好了
I have includes in place for this class
import android.net.Uri;
import android.webkit.HttpAuthHandler;
import android.webkit.MimeTypeMap;
import android.webkit.URLUtil;
import android.webkit.WebView;
import android.webkit.WebViewClient;
有什么想法吗?
推荐答案
import android.webkit.SslErrorHandler;
import android.net.http.SslError;
看起来这两个类缺少导入.
Looks like those two classes are missing imports.
这篇关于添加 onReceivedSslError 时找不到符号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文