]> git.ktnx.net Git - mobile-ledger.git/commitdiff
replace AsyncTask.execute with GeneralBackgroundTasks.run
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 27 Aug 2021 20:12:37 +0000 (20:12 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 27 Aug 2021 20:12:37 +0000 (20:12 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java

index 9ccdf4948fdd6d87ecdf16e1e20c1652e4d23b53..35a9edb7205c84bd16889468d90416b6018d547b 100644 (file)
@@ -18,7 +18,6 @@
 package net.ktnx.mobileledger.ui.account_summary;
 
 import android.content.Context;
-import android.os.AsyncTask;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -32,6 +31,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 
+import net.ktnx.mobileledger.async.GeneralBackgroundTasks;
 import net.ktnx.mobileledger.databinding.AccountSummaryFragmentBinding;
 import net.ktnx.mobileledger.db.AccountWithAmounts;
 import net.ktnx.mobileledger.db.DB;
@@ -118,7 +118,7 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
         DB.get()
           .getAccountDAO()
           .getAllWithAmounts(profile.getId())
-          .observe(getViewLifecycleOwner(), list -> AsyncTask.execute(() -> {
+          .observe(getViewLifecycleOwner(), list -> GeneralBackgroundTasks.run(() -> {
               List<AccountListItem> adapterList = new ArrayList<>();
               adapterList.add(new AccountListItem.Header(Data.lastAccountsUpdateText));
               HashMap<String, LedgerAccount> accMap = new HashMap<>();