show toast in correct thread, closes #371

This commit is contained in:
Philipp Crocoll
2019-10-07 07:13:59 +02:00
parent 049764fe67
commit 684ffb8525

View File

@@ -2147,7 +2147,7 @@ namespace keepass2android
KeyProviderQueryContext ctx = new KeyProviderQueryContext(_act._ioConnection, false, false);
if (!OathHotpKeyProv.CreateAuxFile(_act._otpInfo, ctx, _act._otpAuxIoc))
Toast.MakeText(_act, _act.GetString(Resource.String.ErrorUpdatingOtpAuxFile), ToastLength.Long).Show();
ShowError(_act.GetString(Resource.String.ErrorUpdatingOtpAuxFile));
}
@@ -2155,8 +2155,7 @@ namespace keepass2android
{
Kp2aLog.LogUnexpectedError(e);
Toast.MakeText(_act, _act.GetString(Resource.String.ErrorUpdatingOtpAuxFile) + " " + e.Message,
ToastLength.Long).Show();
ShowError( _act.GetString(Resource.String.ErrorUpdatingOtpAuxFile) + " " + e.Message);
}
@@ -2170,6 +2169,10 @@ namespace keepass2android
}
private void ShowError(string message)
{
App.Kp2a.ShowToast(message);
}
}
private class PasswordActivityBroadcastReceiver : BroadcastReceiver
{