Compartir a través de


WebViewClient.OnReceivedError Method

Definition

Overloads

OnReceivedError(WebView, IWebResourceRequest, WebResourceError)

Report web resource loading error to the host application.

OnReceivedError(WebView, ClientError, String, String)

Report an error to the host application.

OnReceivedError(WebView, IWebResourceRequest, WebResourceError)

Report web resource loading error to the host application.

[Android.Runtime.Register("onReceivedError", "(Landroid/webkit/WebView;Landroid/webkit/WebResourceRequest;Landroid/webkit/WebResourceError;)V", "GetOnReceivedError_Landroid_webkit_WebView_Landroid_webkit_WebResourceRequest_Landroid_webkit_WebResourceError_Handler", ApiSince=23)]
public virtual void OnReceivedError (Android.Webkit.WebView? view, Android.Webkit.IWebResourceRequest? request, Android.Webkit.WebResourceError? error);
[<Android.Runtime.Register("onReceivedError", "(Landroid/webkit/WebView;Landroid/webkit/WebResourceRequest;Landroid/webkit/WebResourceError;)V", "GetOnReceivedError_Landroid_webkit_WebView_Landroid_webkit_WebResourceRequest_Landroid_webkit_WebResourceError_Handler", ApiSince=23)>]
abstract member OnReceivedError : Android.Webkit.WebView * Android.Webkit.IWebResourceRequest * Android.Webkit.WebResourceError -> unit
override this.OnReceivedError : Android.Webkit.WebView * Android.Webkit.IWebResourceRequest * Android.Webkit.WebResourceError -> unit

Parameters

view
WebView

The WebView that is initiating the callback.

request
IWebResourceRequest

The originating request.

error
WebResourceError

Information about the error occurred.

Attributes

Remarks

Report web resource loading error to the host application. These errors usually indicate inability to connect to the server. Note that unlike the deprecated version of the callback, the new version will be called for any resource (iframe, image, etc.), not just for the main page. Thus, it is recommended to perform minimum required work in this callback.

Java documentation for android.webkit.WebViewClient.onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OnReceivedError(WebView, ClientError, String, String)

Report an error to the host application.

[Android.Runtime.Register("onReceivedError", "(Landroid/webkit/WebView;ILjava/lang/String;Ljava/lang/String;)V", "GetOnReceivedError_Landroid_webkit_WebView_ILjava_lang_String_Ljava_lang_String_Handler")]
public virtual void OnReceivedError (Android.Webkit.WebView? view, Android.Webkit.ClientError errorCode, string? description, string? failingUrl);
[<Android.Runtime.Register("onReceivedError", "(Landroid/webkit/WebView;ILjava/lang/String;Ljava/lang/String;)V", "GetOnReceivedError_Landroid_webkit_WebView_ILjava_lang_String_Ljava_lang_String_Handler")>]
abstract member OnReceivedError : Android.Webkit.WebView * Android.Webkit.ClientError * string * string -> unit
override this.OnReceivedError : Android.Webkit.WebView * Android.Webkit.ClientError * string * string -> unit

Parameters

view
WebView

The WebView that is initiating the callback.

errorCode
ClientError

The error code corresponding to an ERROR_* value.

description
String

A String describing the error.

failingUrl
String

The url that failed to load.

Attributes

Remarks

Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable). The errorCode parameter corresponds to one of the ERROR_* constants.

This member is deprecated. Use #onReceivedError(WebView, WebResourceRequest, WebResourceError) onReceivedError(WebView, WebResourceRequest, WebResourceError) instead.

Java documentation for android.webkit.WebViewClient.onReceivedError(android.webkit.WebView, int, java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to