From: Damyan Ivanov Date: Tue, 5 Mar 2019 19:17:50 +0000 (+0200) Subject: move reloading of transaction list in the postExecute method X-Git-Tag: v0.8~46 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=6381561a7e02eb6741536166b60cfdd74eb7ad23;p=mobile-ledger.git 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 --- 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(); }