diff options
| author | Dominik Schürmann <dominik@dominikschuermann.de> | 2016-01-11 17:39:53 +0100 | 
|---|---|---|
| committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2016-01-11 17:39:53 +0100 | 
| commit | 81f23e8b7fac0849ca993f03eb7633bdc9529033 (patch) | |
| tree | 13452a8aefb664af4f6cc613a0a7075c2e7deecb /OpenKeychain/src/main | |
| parent | e66c27c08129b278bcc699a7f2511d69d5dc0a29 (diff) | |
| parent | d30a7d8b81d1c063d66441bd953c49f34fbf08f4 (diff) | |
| download | open-keychain-81f23e8b7fac0849ca993f03eb7633bdc9529033.tar.gz open-keychain-81f23e8b7fac0849ca993f03eb7633bdc9529033.tar.bz2 open-keychain-81f23e8b7fac0849ca993f03eb7633bdc9529033.zip  | |
Merge pull request #1666 from open-keychain/file-import-fix
Fixed File Import issue due to onResumeFragments
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();  | 
