Skip to content

Instantly share code, notes, and snippets.

@crystalz411
Created April 15, 2021 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crystalz411/40a4bf6b11a0795fd77da11c8a9dfafe to your computer and use it in GitHub Desktop.
Save crystalz411/40a4bf6b11a0795fd77da11c8a9dfafe to your computer and use it in GitHub Desktop.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setSupportActionBar(findViewById(R.id.toolbar))
val myWebView = findViewById<WebView>(R.id.webView)
myWebView.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(
view: WebView?,
request: WebResourceRequest?): Boolean {
return false
}
}
myWebView.loadUrl("https://www.google.com")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment