How to get the selected chips from a Chip Group in Kotlin.

  1. Update your Material Gradle dependency version
implementation 'com.google.android.material:material:1.2.1'

2. You get this method: checkedChipIds

tagGroup.checkedChipIds.forEach {
Log.d("TEST", " chip ids ---> " + it)
}

If you are using old material version you don’t have the method: checkedChipIds, and have to create the method. To create local method to return checked chips:

fun ChipGroup.getCheckedChipIds()…