title: how to use multitouch properly - purpose of MotionEvent.getActionIndex()?
body: <p><a href="http://developer.android.com/reference/android/view/MotionEvent.html" rel="nofollow">MotionEvent</a>'s documentation states in Consistency Guarantees that: <em>"(For touch events)... pointers go down one at a time, move around as a group and then go up one at a time or are canceled"</em>.</p>
  
  <p>If I understand correctly, there are two ways one can determine the action that triggered <code>onTouchEvent()</code>:</p>
  
  <ul>
  <li><code>MotionEvent.getAction()</code></li>
  <li><code>MotionEvent.getActionMasked()</code> with <code>MotionEvent.getActionIndex()</code> (this should be used for multitouch, which is what I'm after)</li>
  </ul>
  
  <p>Since <code>getActionMasked()</code> always returns just <code>ACTION_POINTER_DOWN</code> and <code>ACTION_POINTER_UP</code>, according to Consistency Guarantees there should always be <strong>just one</strong> pointer passed inside <code>MotionEvent</code> to <code>onTouchEvent()</code>, which means that <code>MotionEvent.getActionIndex()</code> will always return 0. </p>
  
  <p>If that is so, what is the point of having <code>MotionEvent.getActionIndex()</code> at all? In other words: what am I missing?</p>
  
  <p><strong>UPDATE:</strong> To further clarify my question: <code>MotionEvent.getActionMasked()</code> returns just one action and <code>MotionEvent.getActionIndex()</code> tells us which pointer it applies to. Does that mean that we can't get the action for other pointers? Or if it is the same for all pointers, why specify actionIndex at all?</p>