]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/SplashActivity.java
adopt Room for displaying account lists
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / SplashActivity.java
index 4205c80b5775084c898792bdca8c3115479b0bee..41f3cddf719701171b5b7794404616dc3117e3fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -54,6 +54,7 @@ public class SplashActivity extends CrashReportingActivity {
         startupTime = System.currentTimeMillis();
 
         AsyncTask<Void, Void, Void> dbInitTask = new DatabaseInitTask();
+        Logger.debug("splash", "starting dbInit task");
         dbInitTask.execute();
     }
     @Override
@@ -100,10 +101,10 @@ public class SplashActivity extends CrashReportingActivity {
     private static class DatabaseInitTask extends AsyncTask<Void, Void, Void> {
         @Override
         protected Void doInBackground(Void... voids) {
-            MobileLedgerProfile.loadAllFromDB(null);
+            MobileLedgerProfile.loadAllFromDB(0);
 
-            String profileUUID = MLDB.getOption(MLDB.OPT_PROFILE_UUID, null);
-            MobileLedgerProfile startupProfile = Data.getProfile(profileUUID);
+            long profileId = MLDB.getLongOption(MLDB.OPT_PROFILE_ID, 0);
+            MobileLedgerProfile startupProfile = Data.getProfile(profileId);
             if (startupProfile != null)
                 Data.postCurrentProfile(startupProfile);
             return null;