From 30ba6dce5b52d63cc878ccb49ac4e1c9f830a580 Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 5 Oct 2023 14:37:19 +0530 Subject: [PATCH] Execute `clearAllMessagesIfNeeded` callback on the main thread --- .../com/simplemobiletools/smsmessenger/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt index b213314e..38d78b1e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/extensions/Context.kt @@ -1038,7 +1038,7 @@ fun Context.clearAllMessagesIfNeeded(callback: () -> Unit) { ensureBackgroundThread { messagesDB.deleteAll() config.wasDbCleared = true - callback() + Handler(Looper.getMainLooper()).post(callback) } } else { callback()