I want to link button in my application with a website as when user click on this button the website open in browser, but i keep seeing ViewPostIme pointer 0 and ViewPostIme pointer 1 when i click the button. this my code:
val viewButton = findViewById<Button>(R.id.view_button)
viewButton.setOnClickListener {
val macAddress = scanResultBinding.deviceAddress.toString(){
val url = if (macAddress.isNotEmpty() && macAddress == "//macAddress") {
"MyWebsiteStore"
} else {
"MyWebsiteHome/"
}
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
}