How to determine a long touch on android?

后端 未结 5 2159
走了就别回头了
走了就别回头了 2021-02-12 20:29

I am looking for a way for when a user long touches a mapview (lets say for 1000ms) that i can some how do a certain action.

How would i go about judging how long a use

5条回答
  •  佛祖请我去吃肉
    2021-02-12 21:06

    When MotionEvent.ACTION_UP, endTime will be set to ev.getEventTime(), this make setting endTime to zero when MotionEvent.ACTION_MOVE be not affect. Instead of setting endTime to zero, you should set startTime to ev.getEventTime()

提交回复
热议问题