From 8bda7aa0cff65a9f47053803434c29a9573ded60 Mon Sep 17 00:00:00 2001 From: m2049r Date: Wed, 23 Sep 2020 11:19:28 +0200 Subject: [PATCH] fix crash if auth failed (#684) --- .../send/SendBtcConfirmWizardFragment.java | 13 +++---------- .../fragment/send/SendConfirmWizardFragment.java | 16 ++++------------ 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java b/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java index 007f7ee3..16d43fac 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java @@ -16,24 +16,15 @@ package com.m2049r.xmrwallet.fragment.send; -import android.app.Activity; -import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; -import android.support.design.widget.TextInputLayout; -import android.text.Editable; -import android.text.TextWatcher; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.WindowManager; -import android.view.inputmethod.EditorInfo; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; -import com.m2049r.xmrwallet.BuildConfig; import com.m2049r.xmrwallet.R; import com.m2049r.xmrwallet.data.TxData; import com.m2049r.xmrwallet.data.TxDataBtc; @@ -353,7 +344,9 @@ public class SendBtcConfirmWizardFragment extends SendWizardFragment implements } public void fail(String walletName, String password, boolean fingerprintUsed) { - bSend.setEnabled(sendCountdown > 0); // allow to try again + getActivity().runOnUiThread(() -> { + bSend.setEnabled(sendCountdown > 0); // allow to try again + }); } }); } diff --git a/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendConfirmWizardFragment.java b/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendConfirmWizardFragment.java index 4ec3fec9..b8e5398b 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendConfirmWizardFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendConfirmWizardFragment.java @@ -16,29 +16,19 @@ package com.m2049r.xmrwallet.fragment.send; -import android.app.Activity; -import android.content.DialogInterface; import android.os.Bundle; -import android.support.design.widget.TextInputLayout; import android.support.v7.app.AlertDialog; -import android.text.Editable; -import android.text.TextWatcher; -import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.WindowManager; -import android.view.inputmethod.EditorInfo; -import android.widget.Button; import android.widget.TextView; -import com.m2049r.xmrwallet.BuildConfig; import com.m2049r.xmrwallet.R; import com.m2049r.xmrwallet.data.TxData; +import com.m2049r.xmrwallet.data.UserNotes; import com.m2049r.xmrwallet.model.PendingTransaction; import com.m2049r.xmrwallet.model.Wallet; import com.m2049r.xmrwallet.util.Helper; -import com.m2049r.xmrwallet.data.UserNotes; import timber.log.Timber; @@ -237,7 +227,9 @@ public class SendConfirmWizardFragment extends SendWizardFragment implements Sen } public void fail(String walletName, String password, boolean fingerprintUsed) { - bSend.setEnabled(true); // allow to try again + getActivity().runOnUiThread(() -> { + bSend.setEnabled(true); // allow to try again + }); } }); }