Created
August 19, 2020 18:57
-
-
Save fatihkurcenli/860ac1595fbbe6ddca3da43497343a40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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