android listview的问题。想在我选择所有的item项里面的checkbox后,获取所有勾选checkbox的值?
继承BaseAdapter,复写getView方法。publicvoidonClick(Viewv){if(null!=selectMap.get(position)){...
继承BaseAdapter,复写getView方法。
public void onClick(View v) {
if (null != selectMap.get(position)) {
selectMap.remove(position);
}else {
selectMap.put(position, listData.get(position));
}
Toast.makeText(view.getContext(),
"您选择了:"+ selectMap.size()+"个。",
Toast.LENGTH_SHORT).show();
} 展开
public void onClick(View v) {
if (null != selectMap.get(position)) {
selectMap.remove(position);
}else {
selectMap.put(position, listData.get(position));
}
Toast.makeText(view.getContext(),
"您选择了:"+ selectMap.size()+"个。",
Toast.LENGTH_SHORT).show();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询