Closed akohout closed 10 years ago
I receive the same exception when swiping a ListView entry:
java.lang.ArrayIndexOutOfBoundsException: length=2; index=2130903077
at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6724)
at android.widget.ListView.layoutChildren(ListView.java:1589)
at android.widget.AbsListView.onLayout(AbsListView.java:2091)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:690)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:374)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
I hope you know what's going on there..
I doubt I do :(
Looking at the stack trace, the only part of this libraries code is the plain call to super.onTouchEvent, and AbsListView crashes then somehow. Looking at this, it doesn't seem to be a bug in the library (though you never know, you only wish :D).
Could you perhaps replace the EnhancedListView
in your layout with a ListView
and comment out the methods, that don't exists on the ListView
and see if it still crashes if you touch something?
Oh sh**, you're right ... doing it with a simple ListView also let the app break. I really hoped it was your library :D
Thanks for your advice and sorry for reporting a non-existing exception!
No problem. If you want an wild guess what you might be doing wrong:
Are you using getViewTypeCount()
and getItemViewType()
and returned an integer from getItemViewType
equal or larger than you returned from getViewTypeCount()
(or perhaps a negative number)?
Haha, yeah - you’re right with your wild guess :-) Awesome, thanks!
I had the same trouble when used multiple view types for the ListView. The trick is that view types must start from 0. And not forget to ovverride getViewTypeCount method.
Hey,
first of: cool library!
But I'm facing one problem: When I open the view that contains the EnhancedListView and I start scrolling it simply crashes with an ArrayIndexOutOfBoundsException.
The according stack trace:
To my app:
Do you have any idea what's going on there? Do you need more code? :)