当我单击我的列表视图项目时,它会调用 onitemclick 侦听器,但是当我单击长项目时,它会同时调用 initemclick 和 onitemlongclick 侦听器。如何解决长按时只调用 onitemlongclick 监听器?
list.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
//my code
}
});
list.setOnItemLongClickListener(new OnItemLongClickListener() {
public boolean onItemLongClick(AdapterView<?> arg0, View arg1,int arg2, long arg3) {
//my code
}
}