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.
This commit is contained in:
JosJuice 2023-05-22 11:10:13 +02:00
parent fede2ab9a9
commit 8a78538b2d
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}