listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { //点击事件
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
}
});
listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { //长按事件
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
return true;
}
});
解决点击和长按事件的冲突:将长按事件的返回改为true