Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am relatively new to this still, and I have been developing a small app that would benefit greatly from a user being able to press 2 buttons at one time. What is the best method for achieving this? I dont think that an OnClickListener works like that, and I have seen examples for doing this with an OnTouch event. However, I do not know how to set up button presses with an OnTouch event.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
638 views
Welcome To Ask or Share your Answers For Others

1 Answer

You would have to handle touch events yourself. With the multi-pointers (aka multi-touch) API it's very easy. Just override the onTouchEvent() method or register an OnTouchListener on your buttons.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...