diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2020-04-17 23:04:18 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 23:04:18 +0530 |
commit | 0e1dd641d2d3cfc61b1deb54fe0bb340315f03a1 (patch) | |
tree | d886bc02a3ea29c729a74a2addf5fb0885730b0b | |
parent | b94b52a42ddc2325b539d0956fd0adcf35308b52 (diff) |
AutofillDecryptActivity: Show toast on Main dispatcher (#717)
Without this the activity will crash rather than display the error
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillDecryptActivity.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillDecryptActivity.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillDecryptActivity.kt index 35b1eee9..ba9431d8 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillDecryptActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ui/AutofillDecryptActivity.kt @@ -212,11 +212,13 @@ class AutofillDecryptActivity : Activity(), CoroutineScope { OpenPgpApi.RESULT_CODE_ERROR -> { val error = result.getParcelableExtra<OpenPgpError>(OpenPgpApi.RESULT_ERROR) if (error != null) { - Toast.makeText( - applicationContext, - "Error from OpenKeyChain: ${error.message}", - Toast.LENGTH_LONG - ).show() + withContext(Dispatchers.Main) { + Toast.makeText( + applicationContext, + "Error from OpenKeyChain: ${error.message}", + Toast.LENGTH_LONG + ).show() + } e { "OpenPgpApi ACTION_DECRYPT_VERIFY failed (${error.errorId}): ${error.message}" } } null |