aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-07-06 16:29:18 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2015-07-06 16:29:18 +0200
commit74173b17943a797dd37defd921824fda325bda50 (patch)
treec9269c82373fbbfea57242aa4bde326300460d08 /OpenKeychain/src/main
parent1eb438576d862df8bf8c7221a6bebee7e8dd85f3 (diff)
downloadopen-keychain-74173b17943a797dd37defd921824fda325bda50.tar.gz
open-keychain-74173b17943a797dd37defd921824fda325bda50.tar.bz2
open-keychain-74173b17943a797dd37defd921824fda325bda50.zip
Save mTagHandlingEnabled in saved instance
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java
index 65f8a451c..c472eaa4c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/BaseNfcActivity.java
@@ -65,6 +65,8 @@ public abstract class BaseNfcActivity extends BaseActivity {
public static final int REQUEST_CODE_PIN = 1;
+ public static final String EXTRA_TAG_HANDLING_ENABLED = "tag_handling_enabled";
+
protected Passphrase mPin;
protected Passphrase mAdminPin;
protected boolean mPw1ValidForMultipleSignatures;
@@ -182,7 +184,13 @@ public abstract class BaseNfcActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- mTagHandlingEnabled = true;
+ // Check whether we're recreating a previously destroyed instance
+ if (savedInstanceState != null) {
+ // Restore value of members from saved state
+ mTagHandlingEnabled = savedInstanceState.getBoolean(EXTRA_TAG_HANDLING_ENABLED);
+ } else {
+ mTagHandlingEnabled = true;
+ }
Intent intent = getIntent();
String action = intent.getAction();
@@ -192,6 +200,13 @@ public abstract class BaseNfcActivity extends BaseActivity {
}
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+
+ outState.putBoolean(EXTRA_TAG_HANDLING_ENABLED, mTagHandlingEnabled);
+ }
+
/**
* This activity is started as a singleTop activity.
* All new NFC Intents which are delivered to this activity are handled here