Why android onLongPress always is fired after onDoubleTap?

后端 未结 2 900
南笙
南笙 2020-12-25 15:30

I have onLongPress and onDoubleTap actions placed on the button according to this code:

...
GestureDetector detector = new GestureDetector(this, new TapDetec         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-25 16:07

    You see always the onLongPress fired because in your code you launch an intent before of consuming the onDoubleTap event.
    You can disable onLongPress by
    public void setIsLongpressEnabled (boolean isLongpressEnabled)
    and use the onDown method for performing your action.

提交回复
热议问题