lightbulb_outline Please take our October 2018 developer survey. Start survey

SafeBrowsingResponse

public abstract class SafeBrowsingResponse
extends Object

java.lang.Object
   ↳ android.webkit.SafeBrowsingResponse


Used to indicate an action to take when hitting a malicious URL. Instances of this class are created by the WebView and passed to WebViewClient.onSafeBrowsingHit(WebView, WebResourceRequest, int, SafeBrowsingResponse). The host application must call showInterstitial(boolean), proceed(boolean), or backToSafety(boolean) to set the WebView's response to the Safe Browsing hit.

If reporting is enabled, all reports will be sent according to the privacy policy referenced by WebView.getSafeBrowsingPrivacyPolicyUrl().

Summary

Public constructors

SafeBrowsingResponse()

Public methods

abstract void backToSafety(boolean report)

Act as if the user clicked the "back to safety" button.

abstract void proceed(boolean report)

Act as if the user clicked the "visit this unsafe site" button.

abstract void showInterstitial(boolean allowReporting)

Display the default interstitial.

Inherited methods

Public constructors

SafeBrowsingResponse

added in API level 27
public SafeBrowsingResponse ()

Public methods

backToSafety

added in API level 27
public abstract void backToSafety (boolean report)

Act as if the user clicked the "back to safety" button.

Parameters
report boolean: true to enable Safe Browsing reporting.

proceed

added in API level 27
public abstract void proceed (boolean report)

Act as if the user clicked the "visit this unsafe site" button.

Parameters
report boolean: true to enable Safe Browsing reporting.

showInterstitial

added in API level 27
public abstract void showInterstitial (boolean allowReporting)

Display the default interstitial.

Parameters
allowReporting boolean: true if the interstitial should show a reporting checkbox.