private val checkedList= mutableListOf<String>()
fun getCheckedList()=checkedList
//Viewholder
checkBox.setOnCheckedChangeListener { buttonView, isChecked ->
if (isChecked) checkedAnswers.add(buttonView.text.toString())
else checkedAnswers.remove(buttonView.text.toString())
}
//Fragment/Activity
adapter.getCheckedList()
//Don't know if there is better way
how can i get values of unselected checkboxes ?
Обсуждают сегодня