diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2016-01-11 17:39:59 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2016-01-11 17:39:59 +0100 |
commit | c68b39211e3df7a73aa85fedc177cf7f7d087037 (patch) | |
tree | 30f0b975f67bd55f6a5da1f0404de0dab0b01738 /OpenKeychain/src/main | |
parent | baf0735c96900b30c9b80e85f1d87fdadfbc5613 (diff) | |
parent | 81f23e8b7fac0849ca993f03eb7633bdc9529033 (diff) | |
download | open-keychain-c68b39211e3df7a73aa85fedc177cf7f7d087037.tar.gz open-keychain-c68b39211e3df7a73aa85fedc177cf7f7d087037.tar.bz2 open-keychain-c68b39211e3df7a73aa85fedc177cf7f7d087037.zip |
Merge branch 'master' of github.com:open-keychain/open-keychain
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index 7cb6361eb..dce0d3aaf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -21,6 +21,7 @@ import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.view.View; @@ -89,10 +90,15 @@ public class ImportKeysActivity extends BaseSecurityTokenNfcActivity private CryptoOperationHelper<ImportKeyringParcel, ImportKeyResult> mOperationHelper; + private boolean mFreshIntent; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + // we're started with a new Intent that needs to be handled by onResumeFragments + mFreshIntent = true; + setFullScreenDialogClose(Activity.RESULT_CANCELED, true); findViewById(R.id.import_import).setOnClickListener(new OnClickListener() { @Override @@ -116,15 +122,22 @@ public class ImportKeysActivity extends BaseSecurityTokenNfcActivity public void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); + // new Intent, so onResumeFragments needs to handle it with handleActions(Intent) + mFreshIntent = true; } @Override protected void onResumeFragments() { super.onResumeFragments(); - handleActions(getIntent()); + if (mFreshIntent) { + handleActions(getIntent()); + // we've consumed this Intent, we don't want to repeat the action it represents + // every time the activity is resumed + mFreshIntent = false; + } } - protected void handleActions(Intent intent) { + protected void handleActions(@NonNull Intent intent) { String action = intent.getAction(); Bundle extras = intent.getExtras(); Uri dataUri = intent.getData(); |