在使用ListView时,如果使用了getItemViewType, 记得他的值一定要是从0开始计数的。 且要覆盖getViewTypeCount方法。并且让getViewTypeCount>getItemViewType
否则会有数组越界异常:
10-21 20:18:16.231: E/AndroidRuntime(4475): java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
10-21 20:18:16.231: E/AndroidRuntime(4475): at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6437)
10-21 20:18:16.231: E/AndroidRuntime(4475): at android.widget.ListView.layoutChildren(ListView.java:1559)
10-21 20:18:16.231: E/AndroidRuntime(4475): at android.widget.AbsListView.onLayout(AbsListView.java:2102)
10-21 20:18:16.231: E/AndroidRuntime(4475): at se.davison.sodatools.widget.SectionListView.onLayout(SectionListView.java:147)
10-21 20:18:16.231: E/AndroidRuntime(4475): at android.view.View.layout(View.java:13754)
10-21 20:18:16.231: E/AndroidRuntime(4475): at android.view.ViewGroup.layout(ViewGroup.java:4362)