如何同时使用 OnItemClickListener 和 OnItemLongClickListener 或仅禁用列表视图上的长按?我已经覆盖了 OnItemLongClickListener,当我在 onItemLongClick 上返回 true 时,longclick 将禁用,但 OnItemClickListener 将不再响应。
DailyReportList.setOnItemLongClickListener(new OnItemLongClickListener(){
@Override
public boolean onItemLongClick(AdapterView parentView, View childView, int position, long id) {
return true;}});
registerForContextMenu(DailyReportList);
DailyReportList.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
arg1.showContextMenu();
FillTxtWithListItems(arg1);
}});