Blankj / Blankj/AndroidUtilCode

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

Offen
#1,725 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @Blankj Auf GitHub ansehen
bug
Vorherrschende Sprache
Java
Sterne
33.6k
Forks
10.6k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 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.(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).

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.