Skip to content

Most visited

Recently visited

navigation

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 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 getSafeBrowsingPrivacyPolicyUrl().

Summary

Public constructors

SafeBrowsingResponse()

Public methods

abstract void backToSafety(boolean report)

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

abstract void proceed(boolean report)

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

abstract void showInterstitial(boolean allowReporting)

Display the default interstitial.

Inherited methods

From class java.lang.Object

Public constructors

SafeBrowsingResponse

added in API level 27
SafeBrowsingResponse ()

Public methods

backToSafety

added in API level 27
void backToSafety (boolean report)

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

Parameters
report boolean: True to enable Safe Browsing reporting.

proceed

added in API level 27
void proceed (boolean report)

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

Parameters
report boolean: True to enable Safe Browsing reporting.

showInterstitial

added in API level 27
void showInterstitial (boolean allowReporting)

Display the default interstitial.

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

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)