I am new to Kotlin. I created a fragment and implemented View.OnClickListener and CheckBox.OnCheckedChangeListener. The View.OnClickListener
View.OnClickListener
CheckBox.OnCheckedChangeListener
Use CheckBox.OnCheckedChangeListener like:
checkBox.setOnCheckedChangeListener { buttonView, isChecked -> Toast.makeText(this,isChecked.toString(),Toast.LENGTH_SHORT).show() }
where checkBox is CheckBox ID.
checkBox