From cab1179093225c06fcf4ce19448fb1a3ff3648d0 Mon Sep 17 00:00:00 2001 From: Sade-Tuuli Siipola Date: Tue, 22 Oct 2024 16:14:05 +0300 Subject: [PATCH] Change MainApplication instance init spot There was crashes that were seemingly caused by boot fragment calling the mainApplication instance before the value for the INSTANCE was set, so this pr moves the initialisation of the instance to the earlies spot in the onCreate. As we were unable to recreate the crash, and the crash was most likely invisible to the user, there was no way to verify that this fixes the error. REF: EKIRJASTO-68 --- .../src/main/java/org/librarysimplified/main/MainApplication.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplified-main/src/main/java/org/librarysimplified/main/MainApplication.kt b/simplified-main/src/main/java/org/librarysimplified/main/MainApplication.kt index edd1a5eef..391212952 100644 --- a/simplified-main/src/main/java/org/librarysimplified/main/MainApplication.kt +++ b/simplified-main/src/main/java/org/librarysimplified/main/MainApplication.kt @@ -47,6 +47,7 @@ class MainApplication : Application() { override fun onCreate() { super.onCreate() + INSTANCE = this MainLogging.configure(cacheDir) AppInfoUtil.init(this) @@ -68,7 +69,6 @@ class MainApplication : Application() { this.logStartup() MainTransifex.configure(this.applicationContext) this.boot.start(this) - INSTANCE = this } private fun logStartup() {