]> git.ktnx.net Git - mobile-ledger.git/commitdiff
move reloading of transaction list in the postExecute method
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 5 Mar 2019 19:17:50 +0000 (21:17 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 5 Mar 2019 19:17:50 +0000 (21:17 +0200)
seems more logical, when one thread finishes and signals that to the main
thread, the new task is started

app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 7be2c7468ec15e8dd650d227547a8de3f4e3af18..0fea3004eb211f381cdf058dc46737f36bd6b4e0 100644 (file)
@@ -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;
                     }
index 208303983d55af65d6b5560ee8a77a6b758ea97e..b2ac0aee3114fb72ce5ac97088a25d97b29d7078 100644 (file)
@@ -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();
     }