From 20447b0f25e6e2a4d41f1114ee3f3acf06c61b80 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 22 Dec 2019 11:25:30 +0200 Subject: [PATCH] hook the observer after the activity creation --- .../ui/transaction_list/TransactionListFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java index 505c4063..dcb2d0ce 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java @@ -56,8 +56,6 @@ public class TransactionListFragment extends MobileLedgerListFragment { public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); - Data.backgroundTasksRunning.observe(getViewLifecycleOwner(), - this::onBackgroundTaskRunningChanged); } @Override public void onAttach(@NotNull Context context) { @@ -90,6 +88,9 @@ public class TransactionListFragment extends MobileLedgerListFragment { debug("flow", "TransactionListFragment.onActivityCreated called"); super.onActivityCreated(savedInstanceState); + Data.backgroundTasksRunning.observe(getViewLifecycleOwner(), + this::onBackgroundTaskRunningChanged); + swiper = mActivity.findViewById(R.id.transaction_swipe); if (swiper == null) throw new RuntimeException("Can't get hold on the swipe layout"); -- 2.39.5