Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent OnItemClickListener work when long click performed?

I have a gridview and i want its items to act different if user performs click or long click that is why i am using OnItemClickListener and OnItemLongClickListener but when long click happens both listeners react.I want to perform only OnItemLongClickListener.

like image 887
Tony Avatar asked Oct 16 '10 18:10

Tony


1 Answers

public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {   
   return true;
}

return true will be prevent click event to be continue. It will be perform only OnItemLongClickListener.

like image 105
meizilp Avatar answered Oct 13 '22 18:10

meizilp