GestureLibrary不时在recognize()
为什么呢? 我该怎么做才能防止这种情况发生?
12-28 22:25:06.118:E / DrawActivity(29717): java.lang.IndexOutOfBoundsException:索引0无效,大小为0 12-28
22:25:06.118:E / DrawActivity(29717):at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
12-28 22:25:06.118:E / DrawActivity(29717):at java.util.ArrayList.get(ArrayList.java:304)
12-28 22:25:06.118: E / DrawActivity(29717):at android.gesture.Instance.temporalSampler(Instance.java:91)
12-28 22:25:06.118:E / DrawActivity(29717):at android.gesture.Instance.createInstance(Instance.java:76)
12-28 22:25:06.118:E / DrawActivity(29717):at android.gesture.GestureStore.recognize(GestureStore.java:137)
12-28 22:25:06.118:E / DrawActivity(29717):at android.gesture.GestureLibrary.recognize(GestureLibrary.java:64)
编辑:使用以下方式捕获手势:
<android.gesture.GestureOverlayView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gesture_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:eventsInterceptionEnabled="true"
android:fadeEnabled="false"
android:gestureStrokeAngleThreshold="0."
android:gestureStrokeSquarenessThreshold="0."
android:gestureStrokeType="single"
android:orientation="vertical"/>