diff options
-rw-r--r-- | src/com/android/googlesearch/GoogleSearch.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/googlesearch/GoogleSearch.java b/src/com/android/googlesearch/GoogleSearch.java index e704fb3..73e42ee 100644 --- a/src/com/android/googlesearch/GoogleSearch.java +++ b/src/com/android/googlesearch/GoogleSearch.java @@ -24,10 +24,10 @@ import java.util.Locale; import android.app.Activity; import android.app.SearchManager; -import android.content.ComponentName; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.provider.Browser; import android.provider.SearchRecentSuggestions; import android.text.TextUtils; import android.util.Log; @@ -84,10 +84,8 @@ public class GoogleSearch extends Activity { try { String searchUri = googleSearchUrlBase + URLEncoder.encode(query, "UTF-8"); - Intent launchUriIntent = new Intent(Intent.ACTION_SEARCH); - launchUriIntent.putExtra(SearchManager.QUERY, searchUri); - launchUriIntent.setComponent(new ComponentName( - "com.android.browser", "com.android.browser.BrowserActivity")); + Intent launchUriIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(searchUri)); + launchUriIntent.putExtra(Browser.EXTRA_APPEND_LOCATION, true); launchUriIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(launchUriIntent); } catch (UnsupportedEncodingException e) { |