hi i m new to android i m working on expandable list and i have a sub list of checkbox, so i need to display only checked items size how can i do this ,,,, thanks in advance
expListView.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
CheckBox cb = (CheckBox)v.findViewById( R.id.check1 );
cb.getText().toString();
System.out.println("......"+cb);
if( cb != null )
cb.toggle();
Toast.makeText(
getApplicationContext(),
listDataHeader.get(groupPosition)+ " : "+ listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition), Toast.LENGTH_SHORT).show();
selected=listDataHeader.get(groupPosition)+ " : "+ listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition);
System.out.println("value of" + selected);
String a1=listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition);
limits.add(selected);
//String a= selected.toString();
int si= limits.size();
tv1.setText(a1);
tv2.setText(""+si);
System.out.println("length..."+si);
return false;
}
});
implement this interface in your class OnCheckedChangeListener