ListView random IndexOutOfBoundsException on Froyo

简介: http://stackoverflow.com/questions/8431342/listview-random-indexoutofboundsexception-on-froyo 今天遇到个 AndroidRuntime E java.

http://stackoverflow.com/questions/8431342/listview-random-indexoutofboundsexception-on-froyo

今天遇到个

    AndroidRuntime  E  java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
    AndroidRuntime  E    at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
类似的问题,stackoverflow上是如此解决的:
class MyFixedListView extends ListView { @Override protected void dispatchDraw(Canvas canvas) { try { super.dispatchDraw(canvas); } catch (IndexOutOfBoundsException e) { // samsung error } } }
相关文章
|
9月前
|
Oracle Java 关系型数据库
Random和ThreadLocalRandom区别
Random和ThreadLocalRandom区别
95 3
RecyclerView.notifyItemRemoved导致的数组下标越界问题
我们一般在RecyclerView列表中移除某条Item时会调用 notifyItemRemoved 方法,其还附带了相应的移除特效。
201 0
Math和Random类常用方法
Math和Random类常用方法
112 0
Math.random()获取随机数
Math.random()获取随机数
154 0
C++类中int getX( ) const {return x;}含义
C++类中int getX( ) const {return x;}含义
250 0
成功解决IndexError: index 14 is out of bounds for axis 1 with size 14
成功解决IndexError: index 14 is out of bounds for axis 1 with size 14