Android : How to implement longpress manually in touch event?

前端 未结 4 2047
庸人自扰
庸人自扰 2021-02-11 05:07

Short version: I want a way to start a time-based counter on an onTouchEvent, and test to see if a certain amount of time has passed before responding, as a manual LongTouch det

4条回答
  •  不要未来只要你来
    2021-02-11 05:52

    Just look in the source code of android.

    Long press in GestureDetector starts a delayed message on "key down". When this message is coming before "key up" it is an long press.

    Just a link to the source http://www.devdaily.com/java/jwarehouse/android/core/java/android/view/GestureDetector.java.shtml

提交回复
热议问题