AndroViews icon indicating copy to clipboard operation
AndroViews copied to clipboard

Crashes when tapping with more fingers

Open tacone opened this issue 13 years ago • 1 comments

WorkspaceView crashes when tapping very fast one child window.

To reproduce tap the screen fast using at least two o three fingers, (first with the index finger, then with the second finger, then with the third finger).

I haven't been able to reproduce the issue with just 1 finger, and with two it is difficult to reproduce (at least on a fast smartphone). With three fingers is pretty easy though.

Full stacktrace:

27782 workspace D Intercepted a touch event 27782 MotionEvent V ArrayIndexOutOfBoundsException!!! pointerIndex -1; i -4 27782 AndroidRuntime D Shutting down VM 27782 dalvikvm W threadid=1: thread exiting with uncaught exception (group=0x40025a70) AndroidRuntime E FATAL EXCEPTION: main 27490 AndroidRuntime E java.lang.ArrayIndexOutOfBoundsException 27490 AndroidRuntime E at android.view.MotionEvent.getX(MotionEvent.java:783) 27490 AndroidRuntime E at org.jared.commons.ui.WorkspaceView.handleInterceptMove(WorkspaceView.java:497) 27490 AndroidRuntime E at org.jared.commons.ui.WorkspaceView.onInterceptTouchEvent(WorkspaceView.java:453) 27490 AndroidRuntime E at org.jared.commons.ui.WorkspaceView.onTouchEvent(WorkspaceView.java:592) 27490 AndroidRuntime E at android.view.View.dispatchTouchEvent(View.java:3778) 27490 AndroidRuntime E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:919) 27490 AndroidRuntime E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:958) 27490 AndroidRuntime E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:958) 27490 AndroidRuntime E at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:958) 27490 AndroidRuntime E at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1716) 27490 AndroidRuntime E at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1124) 27490 AndroidRuntime E at android.app.Activity.dispatchTouchEvent(Activity.java:2125) 27490 AndroidRuntime E at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1700) 27490 AndroidRuntime E at android.view.ViewRoot.handleMessage(ViewRoot.java:1802) 27490 AndroidRuntime E at android.os.Handler.dispatchMessage(Handler.java:99) 27490 AndroidRuntime E at android.os.Looper.loop(Looper.java:143) 27490 AndroidRuntime E at android.app.ActivityThread.main(ActivityThread.java:5068) 27490 AndroidRuntime E at java.lang.reflect.Method.invokeNative(Native Method) 27490 AndroidRuntime E at java.lang.reflect.Method.invoke(Method.java:521) 27490 AndroidRuntime E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 27490 AndroidRuntime E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 27490 AndroidRuntime E at dalvik.system.NativeStart.main(Native Method)

tacone avatar Mar 29 '11 11:03 tacone

Hello, My suggestion for quick fix for this one is to add: "if ( pointerIndex == -1 ) return;" at the beginning of handleScrollMove and handleInterceptMove.

Bug happens because findPointerIndex can sometimes return "-1". It seems to work fine with this fix.

ol0 avatar May 26 '11 06:05 ol0