Skip to content

Commit 3fe0bca

Browse files
author
Michael Kolb
committed
add flag to websearch intent
Bug: 6372537 Change-Id: Ia3f8577ffdde2df5234016dd8d9ca83265b53e5e
1 parent d7ba814 commit 3fe0bca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/java/android/webkit/SelectActionModeCallback.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package android.webkit;
1818

19+
import android.app.Activity;
1920
import android.app.SearchManager;
2021
import android.content.ClipboardManager;
2122
import android.content.Context;
@@ -122,6 +123,9 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
122123
Intent i = new Intent(Intent.ACTION_WEB_SEARCH);
123124
i.putExtra(SearchManager.EXTRA_NEW_SEARCH, true);
124125
i.putExtra(SearchManager.QUERY, mWebView.getSelection());
126+
if (!(mWebView.getContext() instanceof Activity)) {
127+
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
128+
}
125129
mWebView.getContext().startActivity(i);
126130
break;
127131

0 commit comments

Comments
 (0)