Single touch in ANDROID

Can I allow the user to touch the screen only once?

Meaning: the user touches the screen, and if he tries to touch the screen again, nothing will happen. I am implementing an approach using canvas to draw objects on the screen.

Thank you in advance!

+7
android android canvas
source share
2 answers

From what you mean, the best way is setClickable () or onTouchEvent.

Check out this link:

  • Response to touch events

  • Turn off all touch screen interactions during animation

  • setEnabled () vs setClickable (), what is the difference?
+5
source share

As noted above - use a boolean variable as a flag and switch it between true and false according to how the user interacts!

0
source share

All Articles