Reputation: 370
I was trying to let the onItemLongClick to execute itself again. But not show how to do it . i am seeking something like performItemClick
but for LongClick instead.
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;
}
});
Upvotes: 0
Views: 20
Reputation: 13922
sure call it recursively:
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;
}
});
Upvotes: 1