How to fix ArrayIndexOutOfBoundsException in your custom ListAdapter

If you are creating your own ListAdapter, perhaps you want to show different list items, or list item headings in your list by overriding the getItemViewType and the getViewTypeCount in the implemented Adapter class, then you may have come across the ArrayIndexOutOfBoundsException, as the example below: ERROR/AndroidRuntime(400): FATAL EXCEPTION: main ERROR/AndroidRuntime(400): java.lang.ArrayIndexOutOfBoundsException ERROR/AndroidRuntime(400): at android.widget.AbsListView$RecycleBin.addScrapView( ERROR/AndroidRuntime(400): at android.widget.AbsListView.trackMotionScroll(

» Read more