summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatish Sampath <satish@android.com>2009-06-16 10:34:30 +0100
committerSatish Sampath <satish@android.com>2009-06-16 10:34:30 +0100
commit8fb5044633aab28aac6e77e147f83e8b1b9f6695 (patch)
tree93af7ff8390d44b5c6e080eb74bd94eb1f16afd7
parent1983ac5904491be7ad158bdb8181cf170f004a02 (diff)
downloadGoogleSearch-8fb5044633aab28aac6e77e147f83e8b1b9f6695.tar.gz
Revert to ACTION_VIEW and use intent extra to add location.
-rw-r--r--src/com/android/googlesearch/GoogleSearch.java8
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) {