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 } } }
相关文章
|
4月前
|
Oracle Java 关系型数据库
Random和ThreadLocalRandom区别
Random和ThreadLocalRandom区别
54 3
|
Android开发
Android (int) (Math.random() * 100 % 4) 的结果
Android (int) (Math.random() * 100 % 4) 的结果
46 0
|
Java 编译器 索引
深入解析Java中的数组复制:System.arraycopy、Arrays.copyOf和Arrays.copyOfRange
当涉及到在Java中处理数组时,有许多方法可供选择,其中一些包括`System.arraycopy()`、`Arrays.copyOf()`和`Arrays.copyOfRange()`。这些方法允许您在不同的数组之间复制数据,但它们之间有一些细微的差异。在本篇博客文章中,我们将深入探讨这些方法,以便您了解何时使用它们以及如何正确使用它们。
423 1
ListView Item多布局的实现
ListView这个小节的最后一节,给大家带来的是ListView多布局Item的实现, 何为ListView Item多布局,打个比方,QQ这种聊天列表
110 0
|
C++ 存储 Java
Arrays.copyOf()与System.arraycopy()的区别
Arrays.copyOf()与System.arraycopy()的区别
169 0
Arrays.copyOf()与System.arraycopy()的区别
|
索引
LeetCode 398. Random Pick Index
给定一个可能含有重复元素的整数数组,要求随机输出给定的数字的索引。 您可以假设给定的数字一定存在于数组中。
84 0
LeetCode 398. Random Pick Index
RecyclerView.notifyItemRemoved导致的数组下标越界问题
我们一般在RecyclerView列表中移除某条Item时会调用 notifyItemRemoved 方法,其还附带了相应的移除特效。
176 0
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionVie
java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionVie
Math和Random类常用方法
Math和Random类常用方法
93 0
有关使用Arrays.asList(array) 转换成List集合之后,对其进行操作抛出UnsupportedOperationException异常的问题
有关使用Arrays.asList(array) 转换成List集合之后,对其进行操作抛出UnsupportedOperationException异常的问题
101 0