mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 10:17:18 +00:00
Clear task on search by scheme
This commit is contained in:
parent
86f247ed02
commit
207f61d9c3
1 changed files with 8 additions and 5 deletions
|
@ -37,14 +37,17 @@ public class ActivitySearch extends ActivityBase {
|
|||
CharSequence query;
|
||||
|
||||
Uri uri = getIntent().getData();
|
||||
if (uri == null || !SEARCH_SCHEME.equals(uri.getScheme()))
|
||||
query = getIntent().getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT);
|
||||
else
|
||||
boolean external = (uri != null && SEARCH_SCHEME.equals(uri.getScheme()));
|
||||
if (external)
|
||||
query = Uri.decode(uri.toString().substring(SEARCH_SCHEME.length() + 1));
|
||||
else
|
||||
query = getIntent().getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT);
|
||||
|
||||
Log.i("External search query=" + query);
|
||||
Intent view = new Intent(this, ActivityView.class);
|
||||
view.putExtra(Intent.EXTRA_PROCESS_TEXT, query);
|
||||
Intent view = new Intent(this, ActivityView.class)
|
||||
.putExtra(Intent.EXTRA_PROCESS_TEXT, query);
|
||||
if (external)
|
||||
view.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(view);
|
||||
|
||||
finish();
|
||||
|
|
Loading…
Reference in a new issue