I know a pointer index can be retrieved in this way
int pointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK) >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
and it is used as a parameter in some methods like event.getPointerId(int pointerIndex)
or event.getX(int pointerIndex)
But I don't understand what is the meaning of it, and how it changes its value from one event to the next
The pointer index only indicates the data’s position within the MotionEvent. Each pointer also has an ID mapping that stays persistent across touch events. You can retrieve this ID for each pointer using MotionEvent.getPointerId(index) and find an index for a pointer ID using MotionEvent.findPointerIndex(id).
This is usually used for multi touch events!
Good tutorial about multi touch:
http://android-developers.blogspot.com.br/2010/06/making-sense-of-multitouch.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With