Skip to content

Instantly share code, notes, and snippets.

@fatihkurcenli
Last active August 19, 2020 18:57
Show Gist options
  • Save fatihkurcenli/c566d0145be1c767d4a68c0ab3e2ce23 to your computer and use it in GitHub Desktop.
Save fatihkurcenli/c566d0145be1c767d4a68c0ab3e2ce23 to your computer and use it in GitHub Desktop.
private var superSafeWebView: WebView? = null
private var safeBrowsingIsInitialized: Boolean = false
// ...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
superSafeWebView = WebView(this).apply {
webViewClient = MyWebViewClient()
safeBrowsingIsInitialized = false
startSafeBrowsing(this@SafeBrowsingActivity, { 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