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.
A:
You can use AdapterView.setOnItemLongClickListener. GridView inherits AdapterView, so you can invoke that method on GridView too.
Tony
2010-10-17 00:00:38
I am using AdapterView.setOnItemLongClickListener already but i am using setOnItemClickListener too and they both react to the long clicks i want to prevent OnItemClickListener react to the long clicks.
Tony
2010-10-17 09:08:31
Try KeyEvent.isLongPress()
Tony
2010-10-18 05:37:03
A:
In order to intercept long cliks (aka tapping) you should imlement GestureDetector.OnGestureListener
barmaley
2010-10-18 07:17:05