val checkBox = AppCompatCheckBox(context).apply { text = "hello" setOnCheckedChangeListener { buttonView, isChecked -> //... } }