From c4bf7c5d1145c3a08211f31633d75c61bbb4bcb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sun, 8 Sep 2013 23:08:30 +0200 Subject: Handle wrong/no passphrase --- .../keychain/demo/CryptoProviderDemoActivity.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'OpenPGP-Keychain-API-Demo/src') diff --git a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java index 8a5d37c8f..db84a1742 100644 --- a/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java +++ b/OpenPGP-Keychain-API-Demo/src/org/sufficientlysecure/keychain/demo/CryptoProviderDemoActivity.java @@ -117,11 +117,18 @@ public class CryptoProviderDemoActivity extends Activity { }; - private void handleError(CryptoError error) { - Toast.makeText(mActivity, "onError id:" + error.getErrorId() + "\n\n" + error.getMessage(), - Toast.LENGTH_LONG).show(); - Log.e(Constants.TAG, "onError getErrorId:" + error.getErrorId()); - Log.e(Constants.TAG, "onError getMessage:" + error.getMessage()); + private void handleError(final CryptoError error) { + mActivity.runOnUiThread(new Runnable() { + + @Override + public void run() { + Toast.makeText(mActivity, + "onError id:" + error.getErrorId() + "\n\n" + error.getMessage(), + Toast.LENGTH_LONG).show(); + Log.e(Constants.TAG, "onError getErrorId:" + error.getErrorId()); + Log.e(Constants.TAG, "onError getMessage:" + error.getMessage()); + } + }); } public void encryptOnClick(View view) { -- cgit v1.2.3