From 4b2c8a13094cc53a834ff30b88eaf5e3229c2878 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 16 May 2015 23:29:59 +0200 Subject: [PATCH] allow state loss when yubikey fragment is loaded --- .../org/sufficientlysecure/keychain/ui/ViewKeyActivity.java | 3 ++- 1 file changed, 2 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 8c1d23d68..320ccee5d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -596,7 +596,8 @@ public class ViewKeyActivity extends BaseNfcActivity implements manager.beginTransaction() .addToBackStack("yubikey") .replace(R.id.view_key_fragment, frag) - .commit(); + // if this is called while the activity wasn't resumed, just forget it happened + .commitAllowingStateLoss(); } private void encrypt(Uri dataUri, boolean text) {