| 构造器 | 说明 |
|---|---|
WebAgent() |
A constructor used to create a
WebAgent instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
isNeedLoadUrl(WebView webView,
ResourceRequest request) |
Checks whether to load a request based on the current
WebView request. |
void |
onAuthRequested(WebView webView,
AuthRequest request,
String host,
String realm) |
Called when an authentication request is initiated.
|
void |
onCertificateRequested(WebView webView,
CertificateRequest request) |
Called when a certificate request is initiated.
|
void |
onError(WebView webView,
ResourceRequest request,
ResourceError error) |
Called when an error occurs during web page loading.
|
void |
onHttpError(WebView webView,
ResourceRequest request,
ResourceResponse response) |
Called when an HTTP error is reported for a request.
|
void |
onLoadingContent(WebView webView,
String url) |
Called when resources are being loaded.
|
void |
onLoadingPage(WebView webView,
String url,
PixelMap icon) |
Called when the page loading starts.
|
void |
onLogin(WebView webView,
String realm,
String account,
String args) |
Called when login is triggered.
|
void |
onPageLoaded(WebView webView,
String url) |
Called when the page loading stops.
|
void |
onSslError(WebView webView,
SslError error) |
Called when an SSL error occurs during web page loading.
|
ResourceResponse |
processResourceRequest(WebView webView,
ResourceRequest request) |
Called when a resource request is initiated.
|
public boolean isNeedLoadUrl(WebView webView, ResourceRequest request)
WebView request.webView - Indicates the related WebView object.request - Indicates the detailed object of the resource request.true if loading is required; returns false otherwise.public void onLoadingPage(WebView webView, String url, PixelMap icon)
webView - Indicates the WebView object that initiates the callback.url - Indicates the URL being loaded.icon - Indicates the website icon.public void onPageLoaded(WebView webView, String url)
webView - Indicates the WebView object that initiates the callback.url - Indicates the URL for which loading has finished.public void onLoadingContent(WebView webView, String url)
webView - Indicates the WebView object that initiates the callback.url - Indicates the URL of the web page being loaded.public void onError(WebView webView, ResourceRequest request, ResourceError error)
webView - Indicates the WebView object that initiates the callback.request - Indicates the request for which the error is reported.error - Indicates the error details.public void onCertificateRequested(WebView webView, CertificateRequest request)
webView - Indicates the WebView object.request - Indicates the certificate request.public void onAuthRequested(WebView webView, AuthRequest request, String host, String realm)
webView - Indicates the WebView object.request - Indicates the authentication request.host - Indicates the host that initiates the authentication request.realm - Indicates the realm for which authentication is requested.public void onLogin(WebView webView, String realm, String account, String args)
webView - Indicates the WebView object.realm - Indicates the realm of the login account.account - Indicates the login account, which may be null.args - Indicates a set of login parameters.public void onHttpError(WebView webView, ResourceRequest request, ResourceResponse response)
webView - Indicates the WebView object.request - Indicates the request.response - Indicates the response.public void onSslError(WebView webView, SslError error)
webView - Indicates the WebView object that initiates the callback.error - Indicates the SSL error.public ResourceResponse processResourceRequest(WebView webView, ResourceRequest request)
webView - Indicates the WebView object.request - Indicates the resource request.ResourceResponse instance.