Workaround problematic motion events
In some rare cases the action index may not be a index into getPointerId. To workaround this issue do the following
-
Change the semnatics of HandleMotionEvent to use the pointer id directly rather than looking up from index in C code.
-
Wrap the java code in a try/catch to catch invalid motion events.