Share via


WebView.StartSafeBrowsing(Context, IValueCallback) Method

Definition

Starts Safe Browsing initialization.

[Android.Runtime.Register("startSafeBrowsing", "(Landroid/content/Context;Landroid/webkit/ValueCallback;)V", "", ApiSince=27)]
public static void StartSafeBrowsing(Android.Content.Context context, Android.Webkit.IValueCallback? callback);
[<Android.Runtime.Register("startSafeBrowsing", "(Landroid/content/Context;Landroid/webkit/ValueCallback;)V", "", ApiSince=27)>]
static member StartSafeBrowsing : Android.Content.Context * Android.Webkit.IValueCallback -> unit

Parameters

context
Context

Application Context.

callback
IValueCallback

will be called on the UI thread with true if initialization is successful, false otherwise.

Attributes

Remarks

Starts Safe Browsing initialization.

URL loads are not guaranteed to be protected by Safe Browsing until after callback is invoked with true. Safe Browsing is not fully supported on all devices. For those devices callback will receive false.

This should not be called if Safe Browsing has been disabled by manifest tag or WebSettings#setSafeBrowsingEnabled. This prepares resources used for Safe Browsing.

This should be called with the Application Context (and will always use the Application context to do its work regardless).

This member is deprecated. In WebView version 122.0.6174.0 and later, this initialization is done automatically, so there is no need to call this API. If called, this API will invoke the callback immediately with true, given that Safe Browsing is enabled and supported on the device.

Java documentation for android.webkit.WebView.startSafeBrowsing(android.content.Context, android.webkit.ValueCallback<java.lang.Boolean>).

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