Single click and double click of a button in android

前端 未结 9 1319
遇见更好的自我
遇见更好的自我 2020-12-05 22:09

In my application i have a button. After single and double clicking of the button will perform separate operation. How can i do that? Thanks

9条回答
  •  一整个雨季
    2020-12-05 22:32

    You may want to consider not using a DoubleTap. It is not a normal Android behavior.

    When I first started programming on the Android, I kept running into things that were really "hard" to do on the android. Over time, I've found that many of them were difficult because they were a pretty bad idea.

    If you are porting an iOS app, or emulating an iOS app's behavior, you may want to consider converting the UI over to Android style behaviors and use a longPress or other 'androidy' gestures.

    Here is a similar question and answer:

    Android: How to detect double-tap?

提交回复
热议问题