Added in API level 27

SafeBrowsingResponse


abstract class SafeBrowsingResponse
kotlin.Any
   ↳ 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 android.webkit.WebViewClient#onSafeBrowsingHit. 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 android.webkit.WebView#getSafeBrowsingPrivacyPolicyUrl().

Summary

Public constructors

Public methods
abstract Unit

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

abstract Unit
proceed(report: Boolean)

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

abstract Unit
showInterstitial(allowReporting: Boolean)

Display the default interstitial.

Public constructors

SafeBrowsingResponse

Added in API level 27
SafeBrowsingResponse()

Deprecated: This class should not be constructed by applications.

Public methods

backToSafety

Added in API level 27
abstract fun backToSafety(report: Boolean): Unit

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
abstract fun proceed(report: Boolean): Unit

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
abstract fun showInterstitial(allowReporting: Boolean): Unit

Display the default interstitial.

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