diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-05-29 21:38:20 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-05-29 21:38:20 +0200 |
commit | 8be6450a367514216edab62791c5328798556fbf (patch) | |
tree | f2aa730d8315977e0de351d3b65b0f5ceaa17783 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java | |
parent | c9f9af660345632426662363754af3f656f2f7e6 (diff) | |
download | open-keychain-8be6450a367514216edab62791c5328798556fbf.tar.gz open-keychain-8be6450a367514216edab62791c5328798556fbf.tar.bz2 open-keychain-8be6450a367514216edab62791c5328798556fbf.zip |
preserve state in DecryptFilesActivity/-Fragment
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java index 234362edc..479b8fd93 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java @@ -112,17 +112,25 @@ public class DecryptFilesFragment extends DecryptFragment { } @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + + outState.putParcelable(ARG_URI, mInputUri); + } + + @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - setInputUri(getArguments().<Uri>getParcelable(ARG_URI)); + Bundle state = savedInstanceState != null ? savedInstanceState : getArguments(); + setInputUri(state.<Uri>getParcelable(ARG_URI)); - if (getArguments().getBoolean(ARG_OPEN_DIRECTLY, false)) { + // should only come from args + if (state.getBoolean(ARG_OPEN_DIRECTLY, false)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { FileHelper.openDocument(DecryptFilesFragment.this, "*/*", REQUEST_CODE_INPUT); } else { - FileHelper.openFile(DecryptFilesFragment.this, mInputUri, "*/*", - REQUEST_CODE_INPUT); + FileHelper.openFile(DecryptFilesFragment.this, mInputUri, "*/*", REQUEST_CODE_INPUT); } } } |