]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/Data.java
fixed a hard to reproduce crash upon returning to the app
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / model / Data.java
index f0ba846ec05d9271a7c4f390631cde6a9906c4e5..f0f3987789e56673285923eee2209dc915d10b13 100644 (file)
@@ -91,6 +91,10 @@ public final class Data {
         backgroundTasksRunning.postValue(cnt > 0);
     }
     public static void setCurrentProfile(@NonNull MobileLedgerProfile newProfile) {
+        MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid());
+        profile.setValue(newProfile);
+    }
+    public static void postCurrentProfile(@NonNull MobileLedgerProfile newProfile) {
         MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid());
         profile.postValue(newProfile);
     }
@@ -200,6 +204,7 @@ public final class Data {
         MobileLedgerProfile startupProfile = getProfile(profileUUID);
         if (startupProfile != null)
             setCurrentProfile(startupProfile);
+        Logger.debug("profile", "initProfile() returning " + startupProfile);
         return startupProfile;
     }