]> git.ktnx.net Git - mobile-ledger.git/commitdiff
AccountSummary: fix stuck refreshing indicator after swipe-refresh is followed by...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 22 Dec 2019 12:57:57 +0000 (14:57 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 22 Dec 2019 12:57:57 +0000 (14:57 +0200)
caused by registering the observer of the background task indicator in the
wrong place

app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java

index 8eef8fbeaf3256ce9d984087760e4b3e39f82e67..cdb2e59a56f5a960d9007236186573c5eeb3d70b 100644 (file)
@@ -46,9 +46,6 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
         super.onCreate(savedInstanceState);
         debug("flow", "AccountSummaryFragment.onCreate()");
         setHasOptionsMenu(true);
-
-        Data.backgroundTasksRunning.observe(this.getViewLifecycleOwner(),
-                this::onBackgroundTaskRunningChanged);
     }
     public void onAttach(@NotNull Context context) {
         super.onAttach(context);
@@ -68,6 +65,9 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
         debug("flow", "AccountSummaryFragment.onActivityCreated()");
         super.onActivityCreated(savedInstanceState);
 
+        Data.backgroundTasksRunning.observe(this.getViewLifecycleOwner(),
+                this::onBackgroundTaskRunningChanged);
+
         modelAdapter = new AccountSummaryAdapter();
 
         mActivity.mAccountSummaryFragment = this;