Android AbsListView $ RecycleBin.addScrapView (AbsListView.java:6588)

So, I do not understand why this error occurs:

04-06 17: 51: 10.252: E / AndroidRuntime (10745): FATAL EXCEPTION: main 04-06 17: 51: 10.252: E / AndroidRuntime (10745): Process: com.stm.classlife, PID: 10745 04-06 17: 51: 10.252: E / AndroidRuntime (10745): java.lang.ArrayIndexOutOfBoundsException: length = 2; index = 2 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.widget.AbsListView $ RecycleBin.addScrapView (AbsListView.java:6588) 04-06 17: 51: 10.252: E / AndroidRuntime (10745 ): at android.widget.ListView.layoutChildren (ListView.java:1632) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.widget.AbsListView.onTouchMove (AbsListView.java:376363) 04- 06 17: 51: 10.252: E / AndroidRuntime (10745): with android.widget.AbsListView.onTouchEvent (AbsListView.java:3632) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view. View.dispatchTouchEvent (View.java:8471) 04-06 17: 51: 10.252:E / AndroidRuntime (10745): at android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2399) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java : 2092) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2405) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2106) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2405) 04-06 17 : 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2106) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.ViewGroup. dispatchTransformedTouchEvent (ViewGroup.java:2405) 04-06 17: 51: 10.252:E / AndroidRuntime (10745): at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2106) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java : 2405) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2106) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at com.android.internal.policy.impl.PhoneWindow $ DecorView.superDispatchTouchEvent (PhoneWindow.java:2369) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at com.android.internal.policy.impl. PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1719) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.app.Activity.dispatchTouchEvent (Activity.java:2742) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.support.v7.app.ActionBarActivityDelegateICS $ WindowCallbackWrapper.dispatchTouchEvent (ActionBarActivityDelegateICS.java:268) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at com.android.internal.policy.impl.PhoneWindow $ DecorView.dispavaTow30ow ) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.View.dispatchPointerEvent (View.java:8666) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android .view.ViewRootImpl $ ViewPostImeInputStage.processPointerEvent (ViewRootImpl.javarige123) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ ViewPostImeInputStage.onProcess (ViewRootImpl.java:3989 04) 06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:3544) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android. view.ViewRootImpl $ InputStage.onDeliverToNext (ViewRootImpl.java:3597) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.forward (ViewRootImpl.java:3563) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ AsyncInputStage.forward (ViewRootImpl.java:3680) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.apply (ViewRootImpl.java:3571) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ AsyncInputStage.apply (ViewRootImpl.java:3737) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:3544) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.onDeliverToNext ( ViewRootImpl.java:3597) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.forward (ViewRootImpl.java:3563) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.apply (ViewRootImpl.java:3571) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:3544) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl .deliverInputEvent (ViewRootImpl.javaPoint807) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java UP781) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java=752) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ WindowInputEventReceiver.onInputEvent (ViewRootImpl. java: 5897) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:185) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents (Native Method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): when android.view.InputEventReceiver.consumeBatchedInputEvents (InputEventReceiver.java:176) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl.doConsumeBatchedInput (ViewRootImpl.java:5868) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.ViewRootImpl $ ConsumeBatchedInputRunnable.run (ViewRootImpl.java:5920) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.Choreographer $ CallbackRecord.run (Choreographer.java:767) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.view.Choreographer.doCallbacks (Choreographer .java: 580) 04-06 17: 51: 10.252:E / AndroidRuntime (10745): with android.view.Choreographer.doFrame (Choreographer .java: 548) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.Choreographer $ FrameDisplayEventReceiver.run (Choreographer .java: 753) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.os.Handler.handleCallback (Handler.java:739) 04-06 17: 51: 10.252: E / AndroidRuntime (10745 ): when android.os.Handler.dispatchMessage (Handler.java:95) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): when android.os.Looper.loop (Looper.java:135) 04- 06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread.main (ActivityThread.java<254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang. reflect.Method.invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Meth548) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.Choreographer $ FrameDisplayEventReceiver.run (Choreographer.java:753) 04-06 17: 51: 10.252: E / AndroidRuntime (10745) : at android.os.Handler.handleCallback (Handler.java:739) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.os.Handler.dispatchMessage (Handler.java:95) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.os.Looper.loop (Looper.java:135) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread .main (ActivityThread.javaPoint254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang.reflect.Method.invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Meth548) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.view.Choreographer $ FrameDisplayEventReceiver.run (Choreographer.java:753) 04-06 17: 51: 10.252: E / AndroidRuntime (10745) : at android.os.Handler.handleCallback (Handler.java:739) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.os.Handler.dispatchMessage (Handler.java:95) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.os.Looper.loop (Looper.java:135) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread .main (ActivityThread.javaPoint254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang.reflect.Method.invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Meth753) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.os.Handler.handleCallback (Handler.java:739) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): when android.os.Handler.dispatchMessage (Handler.java:95) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.os.Looper.loop (Looper.java:135) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread.main (ActivityThread.java//254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang.reflect.Method .invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Meth753) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at android.os.Handler.handleCallback (Handler.java:739) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): when android.os.Handler.dispatchMessage (Handler.java:95) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.os.Looper.loop (Looper.java:135) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread.main (ActivityThread.java//254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang.reflect.Method .invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Methloop (Looper.java:135) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread.main (ActivityThread.java data254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang.reflect.Method.invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Methloop (Looper.java:135) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with android.app.ActivityThread.main (ActivityThread.java data254) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): with java.lang.reflect.Method.invoke (native method) 04-06 17: 51: 10.252: E / AndroidRuntime (10745): at java.lang.reflect.Meth

- , ?

+4
1

:

android.widget.AbsListView $RecycleBin.addScrapView(AbsListView.java:6588)

if (mViewTypeCount == 1) {
    mCurrentScrap.add(scrap);
} else {
    mScrapViews[viewType].add(scrap);
}

, , , . , android.widget.Adapter#getItemViewType(int), java.lang.ArrayIndexOutOfBoundsException: length=2; index=2.

. android.widget.Adapter # getItemViewType (int):

. 0 getViewTypeCount() - 1.

. getItemViewType(int) , . getViewTypeCount() 2, 0 1.

+9

All Articles