Answer the question
In order to leave comments, you need to log in
When developing an Android game, you need to press two buttons at the same time. How?
Actually this is the question. How can I handle multi-touch pressing two buttons? Those. I have two buttons on the interface, and I need to click on them at the same time, and so that they both are clicked on the UI. Is it possible to do this?
Answer the question
In order to leave comments, you need to log in
onTouch (View v, MotionEvent event)
allows you to receive touch events on the screen. If the first finger touched the screen event.getAction() = ACTION_DOWN
, all subsequent fingers - event.getAction() = ACTION_POINTER_DOWN
You can time the time between clicks and if it is, say, less than a second - the click was simultaneous.
More details here and here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question