0

I have initialized chip and it is completely working. the problem is that when i close the chip the chip position is not getting removed from my model class. and multiple chips are able to add with same name.

sp_add_sec_lctn.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
            {
                if (position != 0) {
                    Onchanger_sec_lctn =(Secondary_locatns.get(position - 1).getRack_convention_mapping_id());
                    SecondarylocationRecoded secondarylocationRecoded =  new SecondarylocationRecoded();

                    secondarylocationRecoded.setPrimary_rack_convention_mapping_id(Secondary_locatns.get(position - 1).getRack_convention_mapping_id());
                    secondarylocationRecoded.setRack_convention_mapping_id(Onchanger_period);
                    Selection_id.add(secondarylocationRecoded);
                    entryChip = getChip(entryChipGroup, Secondary_locatns.get(position - 1).getLocation_name());
                    entryChipGroup.addView(entryChip);

                }

            }

            @Override
            public void onNothingSelected(AdapterView<?> parent)
            {
            }
        });
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198

1 Answers1

0

are you removing from both tagList and chipGroup?

tagList.remove(tagName);
chipGroup.removeView(chip);