Last active
June 5, 2017 21:22
-
-
Save raveeshbhalla/186325d1bb25d13bd7a0 to your computer and use it in GitHub Desktop.
How to integrate Google Now into your app (for a quick demo, view: https://www.youtube.com/watch?v=_UBvl_edu1o)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name=".SearchActivity"> | |
<intent-filter> | |
<action android:name="com.google.android.gms.actions.SEARCH_ACTION" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
</intent-filter> | |
</activity> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Somewhere in your activity | |
*/ | |
String query = ""; | |
if (getIntent().getAction() != null && getIntent().getAction().equals("com.google.android.gms.actions.SEARCH_ACTION")) { | |
query = getIntent().getStringExtra(SearchManager.QUERY); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment