diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-09-25 04:08:42 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-09-25 04:08:42 +0200 |
commit | 097430b3e35588dbe007aba4a16a53cc7f92c03b (patch) | |
tree | 1afe06424b9720fa2e054ec4ce9f872e81425ace /OpenKeychain/src/main | |
parent | 7e175ac6730b958bc561cde511b0a29495d40889 (diff) | |
download | open-keychain-097430b3e35588dbe007aba4a16a53cc7f92c03b.tar.gz open-keychain-097430b3e35588dbe007aba4a16a53cc7f92c03b.tar.bz2 open-keychain-097430b3e35588dbe007aba4a16a53cc7f92c03b.zip |
enc-backup: clean up backstack after restore
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeEntryFragment.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeEntryFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeEntryFragment.java index b39acd338..4883e689e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeEntryFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BackupCodeEntryFragment.java @@ -114,7 +114,7 @@ public class BackupCodeEntryFragment extends Fragment implements OnBackStackChan editText.setText(""); } - pushOntoBackStack(); + pushBackStackEntry(); break; @@ -135,14 +135,15 @@ public class BackupCodeEntryFragment extends Fragment implements OnBackStackChan hideKeyboard(); - @ColorInt int black = mCodeEditText[0].getCurrentTextColor(); - @ColorInt int green = getResources().getColor(R.color.android_green_dark); for (EditText editText : mCodeEditText) { editText.setEnabled(false); } + + @ColorInt int black = mCodeEditText[0].getCurrentTextColor(); + @ColorInt int green = getResources().getColor(R.color.android_green_dark); animateFlashText(mCodeEditText, black, green, true); - popFromBackStackNoAction(); + popBackStackNoAction(); break; } @@ -328,14 +329,14 @@ public class BackupCodeEntryFragment extends Fragment implements OnBackStackChan } } - private void pushOntoBackStack() { + private void pushBackStackEntry() { FragmentManager fragMan = getFragmentManager(); mBackStackLevel = fragMan.getBackStackEntryCount(); fragMan.beginTransaction().addToBackStack(BACK_STACK_INPUT).commit(); fragMan.addOnBackStackChangedListener(this); } - private void popFromBackStackNoAction() { + private void popBackStackNoAction() { FragmentManager fragMan = getFragmentManager(); fragMan.removeOnBackStackChangedListener(this); fragMan.popBackStack(BACK_STACK_INPUT, FragmentManager.POP_BACK_STACK_INCLUSIVE); @@ -350,6 +351,13 @@ public class BackupCodeEntryFragment extends Fragment implements OnBackStackChan } } + @Override + public void onViewStateRestored(@Nullable Bundle savedInstanceState) { + super.onViewStateRestored(savedInstanceState); + // we don't really save our state, so at least clean this bit up! + popBackStackNoAction(); + } + private void startBackup(boolean exportSecret) { File filename; String date = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date()); |