AndroidUtilCode icon indicating copy to clipboard operation
AndroidUtilCode copied to clipboard

多线程环境下获取当前栈顶ActivityUtils.getTopActivity() crash

Open android-ext opened this issue 3 years ago • 0 comments

Describe the bug

A clear and concise description of what the bug is.

  • The version of AndroidUtilCode: utilcode:1.30.6

  • The version of device: API 31

The code of bug

getTopActivity()

多线程环境下获取当前栈顶ActivityUtils.getTopActivity()
## The stack of crash

# pool-29-thread-1(5773)

java.util.ConcurrentModificationException
解析原始
java.util.LinkedList$LinkIterator.next(LinkedList.java:124)
java.util.LinkedList.addAll(LinkedList.java:394)
java.util.LinkedList.<init>(LinkedList.java:261)
com.blankj.utilcode.util.UtilsActivityLifecycleImpl.java.util.List getActivityList()(UtilsActivityLifecycleImpl.java:69)
com.blankj.utilcode.util.UtilsActivityLifecycleImpl.android.app.Activity getTopActivity()(UtilsActivityLifecycleImpl.java:57)
com.blankj.utilcode.util.UtilsBridge.android.app.Activity getTopActivity()(UtilsBridge.java)
com.blankj.utilcode.util.ActivityUtils.android.app.Activity getTopActivity()(ActivityUtils.java)

## Screenshots

If applicable, add screenshots to help explain your problem.


## Please delete the current line and the following.

Thank you for supporting [AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode).

android-ext avatar Dec 05 '22 03:12 android-ext