我有一个listview.Listview数据我从数据库填充,我使用customAdapter。在我的customAdapter我有两个textview和一个checkbox.And我没有使用任何POJO类 我想通过复选框获取该列表视图的所有checkitem。 我怎么能这样做。有人请帮助我。
@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();
}