X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Fnew_transaction%2FNewTransactionModel.java;h=ad9c75cd87282307581f5679d5825095734e4110;hp=7ff061a6ea30994bb15437d3297ee4683334f795;hb=40d4f7ebb9085a58133cf47eacf989ed35fa0b4e;hpb=709907abf6ae18e4b85ae85f6cf1c558fed99bd3 diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index 7ff061a6..ad9c75cd 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -18,8 +18,6 @@ package net.ktnx.mobileledger.ui.new_transaction; import android.annotation.SuppressLint; -import android.os.Handler; -import android.os.Looper; import android.text.TextUtils; import androidx.annotation.NonNull; @@ -301,7 +299,7 @@ public class NewTransactionModel extends ViewModel { newItems.add(accRow); } - new Handler(Looper.getMainLooper()).post(() -> replaceItems(newItems)); + Misc.onMainThread(() -> replaceItems(newItems)); }); } private int extractIntFromMatches(MatchResult m, Integer group, Integer literal) { @@ -523,7 +521,7 @@ public class NewTransactionModel extends ViewModel { moveItemLast(newList, singlePositiveIndex); } - new Handler(Looper.getMainLooper()).post(() -> { + Misc.onMainThread(() -> { setItems(newList); noteFocusChanged(1, FocusedElement.Amount); });