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

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

imageview - Detect multitouch with Ontouch listener Android

I currently have an imageview element that upon being touched, that tests if the action is an actiondown event, and if it is, it gets the coordinates of the touch with getraw(x or y) and then carries out an action based on those coordinates. How would I implement this to get two sets of coordinates from a two finger multitouch event?

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

Take a look at the ACTION_POINTER_DOWN action define in MotionEvent. This is the event that will get called when additional fingers come down after the first ACTION_DOWN triggers. You can use methods like getActionMasked() to assist you in determining which finger events are related to.

MotionEvent Docs

HTH


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...