Android - Remove all chips from chipgroup

210 Views Asked by At

How do I remove all chips from a ChipGroup?

I know I can remove one chip by passing it to the removeView method or one chip by it's index by calling the removeViewAt and passing it's index, but I wanted to remove all views.

1

There are 1 best solutions below

0
Leonardo Sibela On BEST ANSWER

You can remove all chips by calling the removeAllViews method:

val chipGroup = findViewById<ChipGroup>(R.id.chip_group)
chipGroup.removeAllViews()