Como faço para abrir determinado link fora do Webview ?
Galera estou com uma duvida, como faço para abrir determinado link fora do Webview ? Segue o código abaixo!
super.onCreate(savedInstanceState)
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
setContentView(R.layout.act_webview_youtube)
webView.webViewClient = WebViewClient()
webView.settings.javaScriptEnabled = true
webView.settings.setSupportMultipleWindows(true);
webView.settings.setJavaScriptCanOpenWindowsAutomatically(true);
val b = intent.extras
id = b!!.get("url") as String
Log.e("id", id)
webView.loadUrl(id)
setupToolbar()
fun setupToolbar() {
val toolbar = findViewById<View>(R.id.toolbar) as Toolbar
setSupportActionBar(toolbar)
val actionBar = supportActionBar
if (actionBar != null) {
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
supportActionBar!!.setHomeButtonEnabled(true)
supportActionBar!!.setTitle("WebView")
}
Kaique
Curtidas 0