0

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.

Leonardo Sibela
  • 1,613
  • 1
  • 18
  • 39

1 Answers1

0

You can remove all chips by calling the removeAllViews method:

val chipGroup = findViewById<ChipGroup>(R.id.chip_group)
chipGroup.removeAllViews()
Leonardo Sibela
  • 1,613
  • 1
  • 18
  • 39