Q:

Can't able to add whole arrayList to ChipGroup

I am working on an application where I need to show multiple chips from the ArrayList.
Please consider the following code:
<android.support.design.chip.ChipGroup
     android:id="@+id/chipGroupProfCreds"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:minHeight="@dimen/_50sdp"/>

Java
Chip lChip = new Chip(SignUpNextActivity.this);
for (int i = 0; i < Constant.arraylistselectedproffesionalcredential.size(); i++) {
    lChip.setText(Constant.arraylistselectedproffesionalcredential.get(i).toString());
    binding.chipGroupProfCreds.addView(lChip);
}

Can you please let me know how can I add the whole Constant.arraylistselectedproffesionalcredential to this ChipGroup.

A:

You can use something like:
  for (String chipText: Constant.arraylistselectedproffesionalcredential){
    Chip lChip = new Chip(this);
    lChip.setText(chipText);
    ....
    chipGroup.addView(lChip);
  }

