7

Is it possible to allow the user to touch the screen only once?

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

Thank you in advance!

Loktar
  • 34,764
  • 7
  • 90
  • 104
chikito1990
  • 229
  • 1
  • 4
  • 13

2 Answers2

5

From what you have in mind, setClickable() or onTouchEvent would be the best way to go.

Have a look on this reference:

Community
  • 1
  • 1
Avanz
  • 7,466
  • 23
  • 54
0

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

Carbon
  • 133
  • 1
  • 4
  • 21