public static MotionEvent obtainMotionEvent( long downTime, long eventTime, int action, int id1, float x1, float y1, int id2, float x2, float y2) { int[] ids = new int[] {id1, id2}; MotionEvent.PointerCoords[] coords = new MotionEvent.PointerCoords[] { createCoords(x1, y1), createCoords(x2, y2)}; return MotionEvent .obtain(downTime, eventTime, action, 2, ids, coords, 0, 1.0f, 1.0f, 0, 0, 0, 0); } }