From cec6c3ab5a884dc49b92055fb684ba66a612e195 Mon Sep 17 00:00:00 2001 From: "M. Dietrich" Date: Fri, 28 Feb 2014 15:18:54 +0100 Subject: [PATCH] prevent null byte[] in case of encoding exc --- .../sufficientlysecure/keychain/demo/IntentActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java b/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java index fdcabaf7c..e8aa2a2e7 100644 --- a/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java +++ b/OpenPGP-Keychain-API/example-app/src/main/java/org/sufficientlysecure/keychain/demo/IntentActivity.java @@ -112,11 +112,11 @@ public class IntentActivity extends PreferenceActivity { byte[] pubkey = null; try { pubkey = TEST_PUBKEY.getBytes("UTF-8"); + intent.putExtra(OpenKeychainIntents.IMPORT_KEY_EXTRA_KEY_BYTES, pubkey); + startActivity(intent); } catch (UnsupportedEncodingException e) { - e.printStackTrace(); + Log.e(Constants.TAG, "UnsupportedEncodingException", e); } - intent.putExtra(OpenKeychainIntents.IMPORT_KEY_EXTRA_KEY_BYTES, pubkey); - startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(IntentActivity.this, "Activity not found!", Toast.LENGTH_LONG).show(); }