This question already has an answer here:
enter image description here this is my fault:
and this is my code
it is a function of baseadapter .And per line of listview just only get a CheckBox .but when I use listview.getChildAt(i), i can not obtain a CheckBox. so ..please help!!
@Override
public View getView(int position, View convertView, ViewGroup parent) {
cursor.moveToPosition(position);
CheckBox rb=new CheckBox(MainActivity.this);
String number=cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)).replace("-","").replace(" ","");
rb.setText(number);
if(isChecked(number)){
rb.setChecked(true);
}
return rb;
}
};
Aucun commentaire:
Enregistrer un commentaire