I am new to Kotlin. I created a fragment and implemented View.OnClickListener and CheckBox.OnCheckedChangeListener. The View.OnClickListener
View.OnClickListener
CheckBox.OnCheckedChangeListener
var checkBox:CheckBox = CheckBox(context) checkBox.setOnCheckedChangeListener { buttonView, isChecked -> if (isChecked) { //Do Whatever you want in isChecked } }