aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/SearchActivity.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-11-16 17:11:51 +0100
committerBananeweizen <bananeweizen@gmx.de>2014-11-16 17:11:51 +0100
commitda2744db9e172e656f67355c8ccbc4988c30a797 (patch)
tree5ed8f3f96b1e44b46d5350e396fa7af435716b1a /main/src/cgeo/geocaching/SearchActivity.java
parentd84d05c05774b71ef021f634bf965382acd11aa2 (diff)
downloadcgeo-da2744db9e172e656f67355c8ccbc4988c30a797.zip
cgeo-da2744db9e172e656f67355c8ccbc4988c30a797.tar.gz
cgeo-da2744db9e172e656f67355c8ccbc4988c30a797.tar.bz2
fix Google Now voice search
This only works after this version of the app has been published. For local testing, run adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query foo cgeo.geocaching
Diffstat (limited to 'main/src/cgeo/geocaching/SearchActivity.java')
-rw-r--r--main/src/cgeo/geocaching/SearchActivity.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/SearchActivity.java b/main/src/cgeo/geocaching/SearchActivity.java
index 4f21a63..ff39187 100644
--- a/main/src/cgeo/geocaching/SearchActivity.java
+++ b/main/src/cgeo/geocaching/SearchActivity.java
@@ -62,6 +62,8 @@ public class SearchActivity extends AbstractActionBarActivity implements Coordin
@InjectView(R.id.trackable) protected AutoCompleteTextView trackableEditText;
@InjectView(R.id.display_trackable) protected Button buttonSearchTrackable;
+ private static final String GOOGLE_NOW_SEARCH_ACTION = "com.google.android.gms.actions.SEARCH_ACTION";
+
@Override
public final void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -81,8 +83,8 @@ public class SearchActivity extends AbstractActionBarActivity implements Coordin
return;
}
- // search query
- if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
+ // search query, from search toolbar or from google now
+ if (Intent.ACTION_SEARCH.equals(intent.getAction()) || GOOGLE_NOW_SEARCH_ACTION.equals(intent.getAction())) {
hideKeyboard();
final String query = intent.getStringExtra(SearchManager.QUERY);
final boolean keywordSearch = intent.getBooleanExtra(Intents.EXTRA_KEYWORD_SEARCH, true);