This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
[Android.Runtime.Register("shouldInterceptRequest", "(Landroid/webkit/WebView;Landroid/webkit/WebResourceRequest;)Landroid/webkit/WebResourceResponse;", "GetShouldInterceptRequest_Landroid_webkit_WebView_Landroid_webkit_WebResourceRequest_Handler")]
public virtual Android.Webkit.WebResourceResponse? ShouldInterceptRequest (Android.Webkit.WebView? view, Android.Webkit.IWebResourceRequest? request);
[<Android.Runtime.Register("shouldInterceptRequest", "(Landroid/webkit/WebView;Landroid/webkit/WebResourceRequest;)Landroid/webkit/WebResourceResponse;", "GetShouldInterceptRequest_Landroid_webkit_WebView_Landroid_webkit_WebResourceRequest_Handler")>]
abstract member ShouldInterceptRequest : Android.Webkit.WebView * Android.Webkit.IWebResourceRequest -> Android.Webkit.WebResourceResponse
override this.ShouldInterceptRequest : Android.Webkit.WebView * Android.Webkit.IWebResourceRequest -> Android.Webkit.WebResourceResponse
Parameters
A
android.webkit.WebResourceResponse
containing the
response information or
null
if the WebView should load the
resource itself.
Attributes
RegisterAttribute
Remarks
Notify the host application of a resource request and allow the application to return the data. If the return value is
null
, the WebView will continue to load the resource as usual. Otherwise, the return response and data will be used.
This callback is invoked for a variety of URL schemes (e.g.,
http(s):
,
data:
,
file:
, etc.), not only those schemes which send requests over the network. This is not called for
javascript:
URLs,
blob:
URLs, or for assets accessed via
file:///android_asset/
or
file:///android_res/
URLs.
In the case of redirects, this is only called for the initial resource URL, not any subsequent redirect URLs.
<p class="note"><b>Note:</b> This method is called on a thread other than the UI thread so clients should exercise caution when accessing private data or the view system.
<p class="note"><b>Note:</b> When Safe Browsing is enabled, these URLs still undergo Safe Browsing checks. If this is undesired, you can use
WebView#setSafeBrowsingWhitelist
to skip Safe Browsing checks for that host or dismiss the warning in
#onSafeBrowsingHit
by calling
SafeBrowsingResponse#proceed
.
Java documentation for
android.webkit.WebViewClient.shouldInterceptRequest(android.webkit.WebView, android.webkit.WebResourceRequest)
.
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.
[Android.Runtime.Register("shouldInterceptRequest", "(Landroid/webkit/WebView;Ljava/lang/String;)Landroid/webkit/WebResourceResponse;", "GetShouldInterceptRequest_Landroid_webkit_WebView_Ljava_lang_String_Handler")]
[System.Obsolete("deprecated")]
public virtual Android.Webkit.WebResourceResponse? ShouldInterceptRequest (Android.Webkit.WebView? view, string? url);
[<Android.Runtime.Register("shouldInterceptRequest", "(Landroid/webkit/WebView;Ljava/lang/String;)Landroid/webkit/WebResourceResponse;", "GetShouldInterceptRequest_Landroid_webkit_WebView_Ljava_lang_String_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member ShouldInterceptRequest : Android.Webkit.WebView * string -> Android.Webkit.WebResourceResponse
override this.ShouldInterceptRequest : Android.Webkit.WebView * string -> Android.Webkit.WebResourceResponse
Parameters
A
android.webkit.WebResourceResponse
containing the
response information or
null
if the WebView should load the
resource itself.
Attributes
RegisterAttribute
ObsoleteAttribute
Remarks
Notify the host application of a resource request and allow the application to return the data. If the return value is
null
, the WebView will continue to load the resource as usual. Otherwise, the return response and data will be used.
This callback is invoked for a variety of URL schemes (e.g.,
http(s):
,
data:
,
file:
, etc.), not only those schemes which send requests over the network. This is not called for
javascript:
URLs,
blob:
URLs, or for assets accessed via
file:///android_asset/
or
file:///android_res/
URLs.
In the case of redirects, this is only called for the initial resource URL, not any subsequent redirect URLs.
<p class="note"><b>Note:</b> This method is called on a thread other than the UI thread so clients should exercise caution when accessing private data or the view system.
<p class="note"><b>Note:</b> When Safe Browsing is enabled, these URLs still undergo Safe Browsing checks. If this is undesired, you can use
WebView#setSafeBrowsingWhitelist
to skip Safe Browsing checks for that host or dismiss the warning in
#onSafeBrowsingHit
by calling
SafeBrowsingResponse#proceed
.
This member is deprecated. Use
#shouldInterceptRequest(WebView, WebResourceRequest) shouldInterceptRequest(WebView, WebResourceRequest)
instead.
Java documentation for
android.webkit.WebViewClient.shouldInterceptRequest(android.webkit.WebView, 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.