【发布时间】:2017-01-24 17:14:10
【问题描述】:
我不想点击适配器的项目(OnItemClickListener),我只想选中项目中的复选框,如果选中,则从该项目中获取数据。
【问题讨论】:
标签: android android-studio checkbox android-adapter
我不想点击适配器的项目(OnItemClickListener),我只想选中项目中的复选框,如果选中,则从该项目中获取数据。
【问题讨论】:
标签: android android-studio checkbox android-adapter
ListView 中有复选框吗? ListView 中的 İf 复选框,您可以使用以下代码:
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
CheckBox checkB=(CheckBox) v.findViewById(R.id.your_checkbox_id);
if(checkB.isChecked()){
//you can get data from here
//for example: checkB.getText();
}
}
【讨论】: