listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
}
});
请帮帮我,伙计们。谢谢你。
答案 0 :(得分:0)
创建一个与listview大小相同的布尔数组,并将项目单击存储在其中。
private Boolean[] itemHasBeenClicked = {false};
然后点击
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//whatever code
itemHasBeenClicked[i] = true;
}
});