How to link button with website in android studio using kotlin

Viewed 11494

I want to link button in my application with a website as when user click on this button the website open in browser or in application ,, I using kotlin not java ,, How can i make it ? :) i try to use this code :

bu1.setOnClickListener({
var gourl= Intent(this,Uri.parse("https://www.facebook.com/"))
startActivity(gourl)
})


 bu1.setOnClickListener({
var gourl= Intent(this,Uri.parse("https://www.facebook.com/"))
startActivity(gourl)
})

 bu1.setOnClickListener({
var gourl= Intent(this,Uri.parse("https://www.facebook.com/"))
startActivity(gourl)
})
1 Answers
Related