概述
http://blog.csdn.net/androiddevelop/article/details/21509345 Java ConcurrentModificationException 异常分析与解决方案
http://www.cnblogs.com/andy-zhou/p/5339683.html Java ConcurrentModificationException异常原因和解决方法
Process: com.android.systemui Flags: 0x38c83e0d Package: com.android.systemui v25 (7.1.1) Foreground: No Build: PROTRULY/DARLING-VR-PHONE/VR7-1:7.1.1/NMF26F/PROTRULY-VR7-7.1.1.100A:user/release-keys java.util.ConcurrentModificationException at java.util.ArrayList$Itr.next(ArrayList.java:831) at com.android.systemui.statusbar.policy.KeyguardMonitor.notifyKeyguardChanged(KeyguardMonitor.java:130) at com.android.systemui.statusbar.policy.KeyguardMonitor.notifyKeyguardState(KeyguardMonitor.java:112) at com.android.systemui.statusbar.phone.PhoneStatusBar.updateKeyguardState(PhoneStatusBar.java:4767) at com.android.systemui.statusbar.phone.PhoneStatusBar.hideKeyguard(PhoneStatusBar.java:4636) at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.hide(StatusBarKeyguardViewManager.java:346) at com.android.systemui.keyguard.KeyguardViewMediator.handleStartKeyguardExitAnimation(KeyguardViewMediator.java:1806) at com.android.systemui.keyguard.KeyguardViewMediator.handleHide(KeyguardViewMediator.java:1762) at com.android.systemui.keyguard.KeyguardViewMediator.handleKeyguardDone(KeyguardViewMediator.java:1580) at com.android.systemui.keyguard.KeyguardViewMediator.-wrap5(KeyguardViewMediator.java) at com.android.systemui.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1498) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6140) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
推荐使用ConcurrentHashMap或者CopyOnWriteArrayList
CopyOnWriteArrayList.java
CopyOnWriteArrayList注意事项
(1) CopyOnWriteArrayList不能使用Iterator.remove()进行删除。
(2) CopyOnWriteArrayList使用Iterator且使用List.remove(Object);会出现如下异常:
java.lang.UnsupportedOperationException: Unsupported operation remove
at java.util.concurrent.CopyOnWriteArrayList$ListIteratorImpl.remove(CopyOnWriteArrayList.java:804)
转载于:https://www.cnblogs.com/onelikeone/p/7065076.html
最后
以上就是细心饼干为你收集整理的java.util.ConcurrentModificationException 多线程访问ArrayList引起的全部内容,希望文章能够帮你解决java.util.ConcurrentModificationException 多线程访问ArrayList引起所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复