So fügen Sie Chips dynamisch Android hinzu

ChipGroup chipGroup = new ChipGroup(parentView.getContext());

String[] genres = {"Thriller", "Comedy", "Adventure"};
for(String genre : genres) {
 Chip chip = new Chip(parentView.getContext());
 chip.setText(genre);
 chipGroup.addView(chip);
}

Worried Wren