summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml2
-rw-r--r--src/com/android/googlesearch/GoogleSearch.java6
2 files changed, 7 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0cd5033..055a1e7 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -21,6 +21,8 @@
package="com.android.googlesearch"
android:sharedUserId="android.uid.shared">
+ <uses-permission android:name="android.permission.INTERNET" />
+
<application
android:process="android.process.acore"
android:label="@string/search_label">
diff --git a/src/com/android/googlesearch/GoogleSearch.java b/src/com/android/googlesearch/GoogleSearch.java
index d429e3a..e704fb3 100644
--- a/src/com/android/googlesearch/GoogleSearch.java
+++ b/src/com/android/googlesearch/GoogleSearch.java
@@ -24,6 +24,7 @@ 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;
@@ -83,7 +84,10 @@ public class GoogleSearch extends Activity {
try {
String searchUri = googleSearchUrlBase + URLEncoder.encode(query, "UTF-8");
- Intent launchUriIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(searchUri));
+ Intent launchUriIntent = new Intent(Intent.ACTION_SEARCH);
+ launchUriIntent.putExtra(SearchManager.QUERY, searchUri);
+ launchUriIntent.setComponent(new ComponentName(
+ "com.android.browser", "com.android.browser.BrowserActivity"));
launchUriIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(launchUriIntent);
} catch (UnsupportedEncodingException e) {