onLongPress and ACTION_MOVE

756 Views Asked by At


I made SimpleOnGestureListener capturing onLongPress with MotionEvent, but the problem is that I can't read event displacement, since I am getting always ACTION_DOWN code. How to achieve that? I want to move some of the views during long clicking.
Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

Using my crystal ball and without seeing your code I can only say that you should capture onTouch event. As one of solution, by onLongPress you can set some bool value (PRESSED, for example) and then in onTouch event handle move event.

Or you can try to play with listeners (set and unset them), but I don't think that it's a good idea.