Android : How to implement longpress manually in touch event?

前端 未结 4 1962
庸人自扰
庸人自扰 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:51

    Answer: Use system clock (elapsedRealtime()) and measure milliseconds since the press was initiated. Easy once you start to get the hang of it.

提交回复
热议问题