Added 250ms delay to notification update

This commit is contained in:
Juha Heinanen
2021-10-20 09:36:35 +03:00
parent eb153d28a1
commit 9d09a91cfb

View File

@ -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 {