From 6381561a7e02eb6741536166b60cfdd74eb7ad23 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Tue, 5 Mar 2019 21:17:50 +0200 Subject: [PATCH] move reloading of transaction list in the postExecute method seems more logical, when one thread finishes and signals that to the main thread, the new task is started --- .../net/ktnx/mobileledger/async/RetrieveTransactionsTask.java | 1 - .../java/net/ktnx/mobileledger/ui/activity/MainActivity.java | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 7be2c746..0fea3004 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -359,7 +359,6 @@ public class RetrieveTransactionsTask Date now = new Date(); profile.setLongOption(MLDB.OPT_LAST_SCRAPE, now.getTime()); Data.lastUpdateDate.set(now); - TransactionListViewModel.scheduleTransactionListReload(); return null; } 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 20830398..b2ac0aee 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 @@ -46,6 +46,7 @@ import net.ktnx.mobileledger.ui.account_summary.AccountSummaryFragment; import net.ktnx.mobileledger.ui.profiles.ProfileDetailFragment; import net.ktnx.mobileledger.ui.profiles.ProfilesRecyclerViewAdapter; import net.ktnx.mobileledger.ui.transaction_list.TransactionListFragment; +import net.ktnx.mobileledger.ui.transaction_list.TransactionListViewModel; import net.ktnx.mobileledger.utils.Colors; import net.ktnx.mobileledger.utils.MLDB; @@ -442,6 +443,7 @@ public class MainActivity extends ProfileThemedActivity { updateLastUpdateTextFromDB(); new RefreshDescriptionsTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + TransactionListViewModel.scheduleTransactionListReload(); } else Toast.makeText(this, error, Toast.LENGTH_LONG).show(); } -- 2.39.5