Skip to content

Instantly share code, notes, and snippets.

@arulwastaken
Created January 23, 2021 12:05
Show Gist options
  • Save arulwastaken/8f3546ab8d30cd42b62f86a705edc451 to your computer and use it in GitHub Desktop.
Save arulwastaken/8f3546ab8d30cd42b62f86a705edc451 to your computer and use it in GitHub Desktop.
WVL implementation
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
WebView.setWebContentsDebuggingEnabled(true)
webview.settings.apply {
javaScriptEnabled = true
}
// wvl implementation
webview.webChromeClient = object : WebViewLogger(application = application) {
override fun onConsoleMessage(consoleMessage: ConsoleMessage?, section: String) {
super.onConsoleMessage(consoleMessage, section)
}
}
webview.loadUrl("https://dev.to")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment