From: Damyan Ivanov Date: Wed, 20 May 2020 20:54:16 +0000 (+0300) Subject: Data.setCurrentProfile: use setValue() instead of postValue() X-Git-Tag: v0.14.0~62 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ee9dd748619dfc797517e25ac74e43ee6234067c;p=mobile-ledger.git Data.setCurrentProfile: use setValue() instead of postValue() this is used in places that need the change now, not at some later point for example, on profile change, which triggers activity recreation/theme change --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Data.java b/app/src/main/java/net/ktnx/mobileledger/model/Data.java index 0539c136..0bdbb1a2 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -76,7 +76,7 @@ public final class Data { public static void setCurrentProfile(MobileLedgerProfile newProfile) { MLDB.setOption(MLDB.OPT_PROFILE_UUID, (newProfile == null) ? null : newProfile.getUuid()); stopTransactionsRetrieval(); - profile.postValue(newProfile); + profile.setValue(newProfile); } public static int getProfileIndex(MobileLedgerProfile profile) { try (LockHolder ignored = profilesLocker.lockForReading()) {