Skip to content

Instantly share code, notes, and snippets.

@fatihkurcenli
Created August 19, 2020 18:57
Show Gist options
  • Save fatihkurcenli/860ac1595fbbe6ddca3da43497343a40 to your computer and use it in GitHub Desktop.
Save fatihkurcenli/860ac1595fbbe6ddca3da43497343a40 to your computer and use it in GitHub Desktop.
private WebView superSafeWebView;
private boolean safeBrowsingIsInitialized;
// ...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
superSafeWebView = new WebView(this);
superSafeWebView.setWebViewClient(new MyWebViewClient());
safeBrowsingIsInitialized = false;
superSafeWebView.startSafeBrowsing(this, new ValueCallback<Boolean>() {
@Override
public void onReceiveValue(Boolean success) {
safeBrowsingIsInitialized = true;
if (!success) {
Log.e("MY_APP_TAG", "Unable to initialize Safe Browsing!");
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment