错误堆栈:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=1at android.support.v4.util.SimpleArrayMap.indexOf(SimpleArrayMap.java:83)at android.support.v4.util.SimpleArrayMap.put(SimpleArrayMap.java:381)

示例错误代码:

final ArrayMap testArrayMap = new ArrayMap();new  Thread("线程1"){@Overridepublic void run() {super.run();while (true){testArrayMap.put("aaa","fffff");}}}.start();new  Thread("线程2"){@Overridepublic void run() {super.run();while (true){testArrayMap.clear();}}}.start();

错误原因:
ArrayMap 不支持多线程,请在一个线程里面使用。不然会导致数组越界。如果想在多线程里面使用,请使用HasTable。

google 的 ArrayMap 本身就没有支持多线程,在最新的support 包里面,如果你还多线程使用ArrayMap,就会throw CME (ConcurrentModificationException)

ArrayMap java.lang.ArrayIndexOutOfBoundsException相关推荐

  1. java arraymap_ArrayMap java.lang.ArrayIndexOutOfBoundsException

    错误堆栈: java.lang.ArrayIndexOutOfBoundsException: length=0; index=1 at android.support.v4.util.SimpleA ...

  2. Java - 错误: quot;java.lang.ArrayIndexOutOfBoundsException: length=1; index=1quot;

    错误: "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1" 本文地址: http://blog.csdn.n ...

  3. java.lang.arr_jxl操作java.lang.ArrayIndexOutOfBoundsException: 441 错误的解决

    评论 # re: jxl操作java.lang.ArrayIndexOutOfBoundsException: 441 错误的解决 [未登录] 2007-04-29 20:14 Robin 不错,实践 ...

  4. java.lang.ArrayIndexOutOfBoundsException异常分析及解决

    2019独角兽企业重金招聘Python工程师标准>>> java.lang.ArrayIndexOutOfBoundsException异常分析及解决 这是一个非常常见的异常,从名字 ...

  5. Tomcat 或JBOSS java.lang.ArrayIndexOutOfBoundsException: 8192 解决方案【转】

    错误信息: 2017-1-17 10:09:39 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() ...

  6. 使用Thumbnailator处理gif图片时遇到java.lang.ArrayIndexOutOfBoundsException: 4096异常处理

    使用Thumbnailator处理gif图片时遇到java.lang.ArrayIndexOutOfBoundsException: 4096异常处理 参考文章: (1)使用Thumbnailator ...

  7. weblogic启动后,抛出大量的java.lang.ArrayIndexOutOfBoundsException异常

    weblogic启动后,抛出大量的java.lang.ArrayIndexOutOfBoundsException异常 参考文章: (1)weblogic启动后,抛出大量的java.lang.Arra ...

  8. java.lang.ArrayIndexOutOfBoundsException

    java.lang.ArrayIndexOutOfBoundsException is a runtime exception, so it's a unchecked exception and d ...

  9. java.lang.arr_以太坊常见问题和错误 / java.lang.ArrayIndexOutOfBoundsException? - 汇智网...

    web3j:智能合约写操作时总是抛出java.lang.ArrayIndexOutOfBoundsException错误,不知道什么问题. 我的代码如下: String hexPrivateKey = ...

最新文章

  1. 2019机器学习比赛_2019顶尖的机器学习课程
  2. android开发学习 ------- 弹出框
  3. js 里面的键盘事件对应的键码
  4. LeetCode 编辑距离 II(DP)
  5. Nginx日志配置详解
  6. 反射创建对象_面试题汇集——java反射
  7. 2019JAVA中ajax不高亮_2019-01-18 ajax请求时,token死活放不大header中
  8. 中小型企业无线网络设计
  9. lisp型材库_基于AutoLISP的AutoCAD标准零件库的开发研究
  10. Web 端集成融云 SDK 如何发送正确图片消息给移动端展示?
  11. html设置字体仿宋GB2312,怎么设置仿宋gb2312字体,仿宋gb2312字体设置教程
  12. 宏基因组公众号4年精华文章目录,收藏贴(2021.1更新)
  13. 点滴生活感悟(更新至29)
  14. 【Spring】@Lazy注解
  15. 计算机专业实习经验总结
  16. java future 源码,读FutureTask源码
  17. Android发展趋势分析
  18. pycharm安装Translation翻译插件
  19. MYSQL安装出现问题(服务无法启动,The service already exists)
  20. 计算机常见故障排除 2017,Windows的十大常见故障和解决方法

热门文章

  1. 调查问卷_员工满意度调查问卷
  2. 使用python套用excel模板_集成python的excel插件模板pyaddin——使用说明
  3. 华为擎云w510_鸿蒙系统之后,华为突然官宣新生态,正式对windows说不
  4. suse linux c 编译环境,SUSE 11中安装GCC开发环境
  5. 另一个小程序 返回的支付结果如何得到_手把手教你测微信小程序
  6. Java处理excel根据某列的值查询,并将结果显示在其他列中
  7. 【趣图】测试刚写完的代码...
  8. 直播APP开发:直播的广告效益和号召力分析
  9. 结构体内字节手动对齐(#pragam pack)
  10. table相关的API