From: Damyan Ivanov Date: Sun, 22 Dec 2019 09:25:30 +0000 (+0200) Subject: hook the observer after the activity creation X-Git-Tag: v0.12.0~121 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=20447b0f25e6e2a4d41f1114ee3f3acf06c61b80;p=mobile-ledger.git hook the observer after the activity creation --- 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");