From 9d09a91cfbf17fe626b5d480d9fe2f7f2bdd1af9 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Wed, 20 Oct 2021 09:36:35 +0300 Subject: [PATCH] Added 250ms delay to notification update --- app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index 9f09bec8..7247cd2c 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -1006,7 +1006,10 @@ class BaresipService: Service() { else contentView.setViewVisibility(R.id.etc, View.INVISIBLE) snb.setContent(contentView) - nm.notify(STATUS_NOTIFICATION_ID, snb.build()) + // Don't know why, but without the delay the notification is not always updated + Timer().schedule(250) { + nm.notify(STATUS_NOTIFICATION_ID, snb.build()) + } } private fun getActionText(@StringRes stringRes: Int, @ColorRes colorRes: Int): Spannable {