- Data.accounts.addObserver(
- (o, arg) -> mActivity.runOnUiThread(() -> modelAdapter.notifyDataSetChanged()));
+ Data.profile.observe(getViewLifecycleOwner(), profile -> profile.getAccounts()
+ .observe(
+ getViewLifecycleOwner(),
+ (accounts) -> onAccountsChanged(
+ profile,
+ accounts)));
+ }
+ private void onAccountsChanged(MobileLedgerProfile profile, ArrayList<LedgerAccount> accounts) {
+ Logger.debug("async-acc", "fragment: got new account list");
+ modelAdapter.setAccounts(profile, accounts);