diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt index 14942c3a..96d2b09f 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -89,6 +89,11 @@ open class BankingPresenter( threadPool.runAsync { readPersistedAccounts() } + + // preloadBankList asynchronously; on Android it takes approximately 18 seconds till banks are indexed for first time -> do it as early as possible + threadPool.runAsync { + bankFinder.preloadBankList() + } } diff --git a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/di/BankingModule.kt b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/di/BankingModule.kt index 83e39308..e9babd98 100644 --- a/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/di/BankingModule.kt +++ b/fints4javaAndroidApp/src/main/java/net/dankito/banking/fints4java/android/di/BankingModule.kt @@ -81,14 +81,7 @@ class BankingModule(internal val mainActivity: AppCompatActivity) { @Provides @Singleton fun provideBankFinder(@Named(IndexFolderKey) indexFolder: File, threadPool: IThreadPool) : IBankFinder { - val bankFinder = LuceneBankFinder(indexFolder) - - // preloadBankList asynchronously; on Android it takes approximately 18 seconds till banks are indexed for first time -> do it as early as possible - threadPool.runAsync { - bankFinder.preloadBankList() - } - - return bankFinder + return LuceneBankFinder(indexFolder) } @Provides