I am using MaterialButtonToggleGroup
with single selection (only one button checked at a time). How to check if none of the buttons is checked?
toggleGroup?.addOnButtonCheckedListener { group, checkedId, isChecked ->
if (isChecked) {
when (checkedId) {
R.id.first_materialButton -> {
// do something when selected
}
R.id.second_materialButton -> {
// do something when selected
}
}
}
}