Blankj / Blankj/AndroidUtilCode

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

Aperta
#1,725 0 commenti 0 reazioni 1 assegnatario Rivendicata da @Blankj Vedi su GitHub
bug
Lingua principale
Java
Stelle
33.6k
Fork
10.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.