自定义列表视图中的多项选择,不带复选框

时间:2016-07-21 12:26:08

标签: android list android-activity icons custom-lists

我的custom listview右侧有一个图标,我必须在custom listview中选择多个项目,选择项目我必须用其他图标替换该图标,当我点击替换的图标时再次,我需要获得以前的图标。 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);
            }
        });

0 个答案:

没有答案