0

I have a listview.Listview data i am populating from database and i am using customAdapter .In my customAdapter i have two textview and one checkbox.And i am not using any POJO class I want to get all the checkeditem of that listview on check of checkbox. How i can do that.anyone please help me.

            @Override
            public View getView(final int position, View convertView, ViewGroup parent) {
                // TODO Auto-generated method stub
                final ViewHolder holder;
                if (convertView == null) {
                    holder = new ViewHolder();
                    mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                    convertView = mInflater.inflate(R.layout.inner_layout, null);

                    holder.tv_name = (TextView) convertView.findViewById(R.id.tv_name);
holder.tv_name1 = (TextView) convertView.findViewById(R.id.tv_name1);
                    holder.checkBox = (CheckBox) convertView.findViewById(R.id.checkBox);
                    holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

                            @Override
                            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                                  if(isChecked){

                                  }else{

                                  }

                            }
                        });
                    convertView.setTag(holder);
                } else {
                    holder = (ViewHolder) convertView.getTag();
                }
ananya
  • 1,001
  • 6
  • 33
  • 50
  • Tis a little bit confusing. Do you mean if a single checkbox is checked, you want to have all the items in the listview to be selected? – AL. May 09 '16 at 13:12
  • not a single checkbox.If 3 checkbox selected then i want to show those 3 selected text in a toast message – ananya May 10 '16 at 05:40

0 Answers0