From 1f828528d37ba272a07af67babc85cc7f362f4d9 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Mon, 2 Mar 2015 17:43:42 +0100 Subject: [PATCH] don't reload qr code for identical fingerprint --- .../org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index 742cde75c..0be6c26f6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -803,6 +803,7 @@ public class ViewKeyActivity extends BaseActivity implements mName.setText(R.string.user_id_no_name); } + String oldFingerprint = mFingerprint; mMasterKeyId = data.getLong(INDEX_MASTER_KEY_ID); mFingerprint = KeyFormattingUtils.convertFingerprintToHex(data.getBlob(INDEX_FINGERPRINT)); @@ -866,8 +867,11 @@ public class ViewKeyActivity extends BaseActivity implements mStatusText.setText(R.string.view_key_my_key); mStatusImage.setVisibility(View.GONE); color = getResources().getColor(R.color.primary); + // reload qr code only if the fingerprint changed + if ( !mFingerprint.equals(oldFingerprint)) { + loadQrCode(mFingerprint); + } photoTask.execute(mFingerprint); - loadQrCode(mFingerprint); mQrCodeLayout.setVisibility(View.VISIBLE); // and place leftOf qr code