Answers for "kotlin onclicklistener"

8

setOnClickListener example kotlin

// set on-click listener
btn_click_me.setOnClickListener {
    Toast.makeText(this, "You clicked me.", Toast.LENGTH_SHORT).show()
}
Posted by: Guest on May-05-2020
1

on click in kotlin

button.setOnClickListener(object : View.OnClickListener {
            override fun onClick(v: View?) {
                //your implementation goes here
            }
        })
Posted by: Guest on December-22-2020
1

kotlin onclicklistener

text_view.setOnClickListener {
    val intent = Intent(this@MainActivity, SecondActivity::class.java)
    intent.putExtra("key", "Kotlin")
    startActivity(intent)
}
Posted by: Guest on February-08-2021

Code answers related to "kotlin onclicklistener"

Browse Popular Code Answers by Language