diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-07-07 22:19:20 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-07-07 22:23:08 +0200 |
commit | 65362beaf9f976d6d6e6da6a4ef41adeec8ca43b (patch) | |
tree | b6ab9e9d84aa5ab1350d2128ed25acc391eaff20 /OpenKeychain/src | |
parent | 00951bc4c7edce2456a814c09f2e99c1a34121d6 (diff) | |
download | open-keychain-65362beaf9f976d6d6e6da6a4ef41adeec8ca43b.tar.gz open-keychain-65362beaf9f976d6d6e6da6a4ef41adeec8ca43b.tar.bz2 open-keychain-65362beaf9f976d6d6e6da6a4ef41adeec8ca43b.zip |
move queued action handling from prev commit into onActivityCreated
Diffstat (limited to 'OpenKeychain/src')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java index a997dc545..6e41e97a8 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java @@ -225,6 +225,33 @@ public class CreateKeyFinalFragment extends Fragment { } } } + + // handle queued actions + + if (mQueuedFinishResult != null) { + finishWithResult(mQueuedFinishResult); + return; + } + + if (mQueuedDisplayResult != null) { + try { + displayResult(mQueuedDisplayResult); + } finally { + // clear after operation, note that this may drop the operation if it didn't + // work when called from here! + mQueuedDisplayResult = null; + } + } + + if (mQueuedSaveKeyResult != null) { + try { + uploadKey(mQueuedSaveKeyResult); + } finally { + // see above + mQueuedSaveKeyResult = null; + } + } + } private void createKey() { @@ -433,35 +460,4 @@ public class CreateKeyFinalFragment extends Fragment { activity.finish(); } - @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - - // there may be queued actions from when we weren't attached to an activity! - - if (mQueuedFinishResult != null) { - finishWithResult(mQueuedFinishResult); - return; - } - - if (mQueuedDisplayResult != null) { - try { - displayResult(mQueuedDisplayResult); - } finally { - // clear after operation, note that this may drop the operation if it didn't - // work when called from here! - mQueuedDisplayResult = null; - } - } - - if (mQueuedSaveKeyResult != null) { - try { - uploadKey(mQueuedSaveKeyResult); - } finally { - // see above - mQueuedSaveKeyResult = null; - } - } - } - } |