Keywords: multitouch, controls, buttons, Android, while pressing "maybe this will help more people retrieve it?" 】
A long time did not write blog, recently in the process of graduation design, encountered such a problem, has not encountered before, took some detours, now write down the record.
In the process of Baidu did not see the relevant answers, and more still take you to the detour. Let's get to the bottom of the blog.
Problem: Implement the "Baidu handle" of this multiple buttons, while clicking, that is, a button point is not put, another button is clicked.
In fact, many people's first reaction is that this stuff is not the original Android can it? And then vowed to write a demo and found that in fact not.
Everyone will listen to the touch event, and then do the processing, you can find that you press the first button, and then press the other button, the other buttons of the touch is not to be executed, but to go to the first button touch inside the process flow.
Immediately after everyone to Baidu, Baidu everyone with you answer is with multi-touch, and a bunch of information very clearly tell you to listen to a few fingers to tap the screen .... At this point your heart's answer is basically stereotypes, and then began to write multi-touch processing process.
In the end you will find that you are dealing with your own problems, and you need to go through your finger x, y to determine what controls are now clicked. Then you will encounter a problem, the last finger bouncing events and can not be heard.
With all that said, in the end you just need to add a single line of properties to the parent layout of these buttons.
Android:splitmotionevents= "true"
Some people say this is called whether Global multitouch is supported, false is not supported, true is supported.
And I think this is to see if you want to divert the touch event to each corresponding control.
Sometimes know less, it becomes the time cost!!
Android presses multiple buttons at the same time