]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryAdapter.java
provide a common routine for running something on the main thread
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / account_summary / AccountSummaryAdapter.java
index 3a6130754db2dc8e2f064daf2516886733529287..6b8d0930f4920d10edfd62f7ec2e9df70a4faac2 100644 (file)
@@ -19,8 +19,6 @@ package net.ktnx.mobileledger.ui.account_summary;
 
 import android.content.res.Resources;
 import android.os.AsyncTask;
-import android.os.Handler;
-import android.os.Looper;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -162,7 +160,7 @@ public class AccountSummaryAdapter extends RecyclerView.Adapter<AccountSummaryAd
         return (position == 0) ? ITEM_TYPE_HEADER : ITEM_TYPE_ACCOUNT;
     }
     public void setAccounts(List<AccountListItem> newList) {
-        new Handler(Looper.getMainLooper()).post(() -> listDiffer.submitList(newList));
+        Misc.onMainThread(() -> listDiffer.submitList(newList));
     }
     static class Change {
         static final int NAME = 1;