diff --git a/vector/src/main/java/im/vector/riotx/features/popup/PopupAlertManager.kt b/vector/src/main/java/im/vector/riotx/features/popup/PopupAlertManager.kt index 7382ad9fd5..26e50de65d 100644 --- a/vector/src/main/java/im/vector/riotx/features/popup/PopupAlertManager.kt +++ b/vector/src/main/java/im/vector/riotx/features/popup/PopupAlertManager.kt @@ -45,7 +45,9 @@ object PopupAlertManager { synchronized(alertFiFo) { alertFiFo.add(alert) } - displayNextIfPossible() + weakCurrentActivity?.get()?.runOnUiThread { + displayNextIfPossible() + } } fun cancelAlert(uid: String) { @@ -62,8 +64,10 @@ object PopupAlertManager { //it could also be the current one if (currentAlerter?.uid == uid) { - Alerter.hide() - currentIsDismissed() + weakCurrentActivity?.get()?.runOnUiThread { + Alerter.hide() + currentIsDismissed() + } } }