Skip to content Skip to sidebar Skip to footer

Android Abslistview$recyclebin.addscrapview(abslistview.java:6588)

So, I don't understand why appear this error: 04-06 17:51:10.252: E/AndroidRuntime(10745): FATAL EXCEPTION: main 04-06 17:51:10.252: E/AndroidRuntime(10745): Process: com.stm.

Solution 1:

From your crash logs here is the relevant line:

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

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

Essentially this happens when you scroll a list view item off-screen and the recycler tries to reclaim it. View type for this view, as returned by android.widget.Adapter#getItemViewType(int), is throwing your java.lang.ArrayIndexOutOfBoundsException: length=2; index=2.

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

Note: Integers must be in the range 0 to getViewTypeCount() - 1.

I had the same problem. Check your override method for getItemViewType(int), and ensure that you're returning consecutive zero-index numbers. Since your getViewTypeCount() method is returning 2, then your constants for item type must be 0 and 1.

Post a Comment for "Android Abslistview$recyclebin.addscrapview(abslistview.java:6588)"