From 8a78538b2dc1fc37e3574057100c88973be12def Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 22 May 2023 11:10:13 +0200 Subject: [PATCH] Android: Don't show analytics dialog for destroyed activity Should fix one of the reported crashes on Google Play. The issue can happen if you leave the activity during directory initialization. --- .../src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.kt index c8aa483d5815..5f3d2fc3cb6f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Analytics.kt @@ -20,7 +20,7 @@ object Analytics { @JvmStatic fun checkAnalyticsInit(activity: FragmentActivity) { - AfterDirectoryInitializationRunner().runWithoutLifecycle { + AfterDirectoryInitializationRunner().runWithLifecycle(activity) { if (!BooleanSetting.MAIN_ANALYTICS_PERMISSION_ASKED.boolean) { AnalyticsDialog().show(activity.supportFragmentManager, AnalyticsDialog.TAG) }