aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeDisplayFragment.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeDisplayFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeDisplayFragment.java
index bd5d53d7c..89fadd8b7 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeDisplayFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeDisplayFragment.java
@@ -45,7 +45,13 @@ public class BackupCodeDisplayFragment extends Fragment {
private Button vOkButton;
public static BackupCodeDisplayFragment newInstance() {
- return new BackupCodeDisplayFragment();
+ BackupCodeDisplayFragment frag = new BackupCodeDisplayFragment();
+
+ Bundle args = new Bundle();
+ args.putString(ARG_BACKUP_CODE, generateRandomCode());
+ frag.setArguments(args);
+
+ return frag;
}
@Override
@@ -68,7 +74,7 @@ public class BackupCodeDisplayFragment extends Fragment {
super.onViewCreated(view, savedInstanceState);
if (savedInstanceState == null) {
- mBackupCode = generateRandomCode();
+ mBackupCode = getArguments().getString(ARG_BACKUP_CODE);
} else {
mBackupCode = savedInstanceState.getString(ARG_BACKUP_CODE);
}