0
喜即時通訊新到Android IM擴展列表上的工作,我有複選框的子列表,所以我需要只顯示選中的項目規模我怎麼能做到這一點,,, ,在此先感謝如何讓數組的大小隻有當複選框被選中
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;
}
});
感謝dilavar,如果我想減去數組大小的長度時複選框的勾選,那麼我該怎麼辦 – vaijunath 2014-11-22 06:19:15