我试图让onItemLongClick再次执行自己。但没有说明如何做到这一点。我正在寻找像performItemClick
这样的东西,而不是LongClick。
lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
int pos, long id) {
if (counter == 0) {
counter++;
// code to let the longclick method to run again
return true;
}
// logic TODO
return true;
}
});
答案 0 :(得分:1)
肯定会递归调用它:
lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
int pos, long id) {
if (counter == 0) {
counter++;
// code to let the longclick method to run again
return onItemLongClick(parent, view, position, id);
}
// logic TODO
return true;
}
});