0

I am having custom listview with an icon at right end,I have to select multiple items in custom listview, on selecting items I have to replace that icon with another icons and when I click the replaced icon again I need to get previous icon. Like This

 if (convertView == null){
            convertView = mlayoutInflater.inflate(R.layout.custom_list_of_waitlist_providers,null);
            tvProviderName = (CustomTextView) convertView.findViewById(R.id.tv_provider_name);
            tvProviderSuburb = (CustomTextView) convertView.findViewById(R.id.tv_provider_suburb);
            tvProviderCity = (CustomTextView) convertView.findViewById(R.id.tv_provider_city);
            tvProviderPostCode = (CustomTextView) convertView.findViewById(R.id.tv_provider_post_code);
            icAdd = (ImageButton) convertView.findViewById(R.id.ic_add_provider);
        }
        s = map.get("providerName");
        tvProviderName.setText(s);
        tvProviderSuburb.setText(map.get("suburb"));
        tvProviderCity.setText(map.get("city"));
        tvProviderPostCode.setText(map.get("postCode"));

        icAdd.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                icAdd.setImageResource(R.drawable.ic_check);
            }
        });
Sathish Kumar J
  • 4,280
  • 1
  • 20
  • 48
ajay110125
  • 81
  • 2
  • 5
  • Use POJO class implementation to manage selected items and if possible provide some code – Nisarg Jul 21 '16 at 12:29
  • visit this [Answer - 1](http://stackoverflow.com/questions/37179789/how-to-get-list-of-checked-contacts/37201604#37201604) or [Answer - 2](http://stackoverflow.com/questions/37038293/maintaining-checkbox-states-in-listview-with-cursoradapter/37044624#37044624) – Bharatesh Jul 21 '16 at 13:14

0 Answers0