From c288e6b8face1f02e18a1a1a4f2dde4d48a2e576 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:00:30 +0700 Subject: [PATCH] Fix ANR when opening from notification/widget (#8683) --- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 4c05967cf..d5e27742a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -73,7 +73,6 @@ import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking import logcat.LogPriority import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -325,9 +324,11 @@ class MainActivity : BaseActivity() { } override fun onNewIntent(intent: Intent) { - val handle = runBlocking { handleIntentAction(intent) } - if (!handle) { - super.onNewIntent(intent) + lifecycleScope.launch { + val handle = handleIntentAction(intent) + if (!handle) { + super.onNewIntent(intent) + } } }