Fix / crash not called on UI Thread

This commit is contained in:
Valere 2019-07-03 19:36:25 +02:00
parent 2a2431e490
commit 2eee25bbc1

View File

@ -45,8 +45,10 @@ object PopupAlertManager {
synchronized(alertFiFo) { synchronized(alertFiFo) {
alertFiFo.add(alert) alertFiFo.add(alert)
} }
weakCurrentActivity?.get()?.runOnUiThread {
displayNextIfPossible() displayNextIfPossible()
} }
}


fun cancelAlert(uid: String) { fun cancelAlert(uid: String) {
synchronized(alertFiFo) { synchronized(alertFiFo) {
@ -62,10 +64,12 @@ object PopupAlertManager {


//it could also be the current one //it could also be the current one
if (currentAlerter?.uid == uid) { if (currentAlerter?.uid == uid) {
weakCurrentActivity?.get()?.runOnUiThread {
Alerter.hide() Alerter.hide()
currentIsDismissed() currentIsDismissed()
} }
} }
}




fun onNewActivityDisplayed(activity: Activity) { fun onNewActivityDisplayed(activity: Activity) {