From: Damyan Ivanov Date: Sun, 20 Sep 2020 12:31:39 +0000 (+0300) Subject: when switching profiles, clear account list too X-Git-Tag: v0.15.0~2 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=5989f5a490a6e212bffc3f50fa2fd6e5a07d4b37;p=mobile-ledger.git when switching profiles, clear account list too --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java index 5ca0e0be..44a6f303 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/MainModel.java @@ -271,6 +271,7 @@ public class MainModel extends ViewModel { public void clearUpdateError() { updateError.postValue(null); } + public void clearAccounts() { displayedAccounts.postValue(new ArrayList<>()); } public void clearTransactions() { displayedTransactions.setValue(new ArrayList<>()); } diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 3b440951..dc4645bc 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -439,6 +439,7 @@ public class MainActivity extends ProfileThemedActivity { mProfileListAdapter.notifyDataSetChanged(); + mainModel.clearAccounts(); mainModel.clearTransactions(); if (haveProfile) {