Detecting long touch press (ACTION_DOWN only)??

by eminemence » Thu, 02 Sep 2010 01:55:07 GMT

Sponsored Links
I want to figure out how to detect that the user has been doing a long
touch press on the screen?
Most of the solutions that I see assume that the DOWN + UP sequence of
Thanks in advance.


Detecting long touch press (ACTION_DOWN only)??

by fr4gus » Thu, 02 Sep 2010 02:22:06 GMT

 If you don't have a requirement about how long should be the time to
trigger a long press, you could use



If you need to detect a long in a specific View object, what I do is
to register a OnTouchListener in my View object, that will redirect
the MotioEvent to the GestureDetector. At this point I'm able to
record what View was touched, and keep it in a variable of my current
Activity. Then in the gesture listener I took this variable and use
it. But if someone else knows a better approach I would like to hear
it :).




Sponsored Links

Other Threads

1. Blackberry storm

On comments on how we think this'll shape up to the G1?

Al Sutton


2. Landscape mode for the Emulator?

Keypad 7 / Home
you also might need to toggle your numlock button.


3. Attempt to include a core VM class in something other than a core library

4. Spinner gets error when drop down

5. problem installing updates for ADT

6. Hello, Please help me get back into the developer group discussion board

7. Emulator crashes X on Ubuntu 8.4