Java tutorial
//package com.java2s; import android.view.MotionEvent; public class Main { private static int[] getPointerIds(final MotionEvent motionEvent) { final int pointerCount = motionEvent.getPointerCount(); final int[] array = new int[pointerCount]; for (int i = 0; i < pointerCount; ++i) { array[i] = motionEvent.getPointerId(i); } return array; } }