chikito1990
chikito1990

Reputation: 239

Single touch in ANDROID

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!

Upvotes: 7

Views: 201

Answers (2)

Carbon
Carbon

Reputation: 133

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

Upvotes: 0

Avanz
Avanz

Reputation: 7466

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

Have a look on this reference:

Upvotes: 5

Related Questions