Skip to content

Commit

Permalink
Merge pull request #255 from shanempope/dev
Browse files Browse the repository at this point in the history
Fixing issue where Search opens new task instead of using same task.
  • Loading branch information
bpellin authored Jan 3, 2018
2 parents 981fef8 + 052641c commit 2c7b19d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/src/main/java/com/keepassdroid/GroupBaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
Expand Down Expand Up @@ -278,6 +279,22 @@ public void run() {
}
}
}

@Override
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
/*
* ACTION_SEARCH automatically forces a new task. This occurs when you open a kdb file in
* another app such as Files or GoogleDrive and then Search for an entry. Here we remove the
* FLAG_ACTIVITY_NEW_TASK flag bit allowing search to open it's activity in the current task.
*/
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
int flags = intent.getFlags();
flags &= ~Intent.FLAG_ACTIVITY_NEW_TASK;
intent.setFlags(flags);
}

super.startActivityForResult(intent, requestCode, options);
}

public class AfterDeleteGroup extends OnFinish {
public AfterDeleteGroup(Handler handler) {
Expand Down

0 comments on commit 2c7b19d

Please sign in to comment.