First of fall sorry for my weak english i want to open my app by "Ok google" with search query. But not Open my app With "Ok Google". I get stuck in it. So suggest me where i wrong
But Open My App When I try to say open in "Ok Google" with "Open App Name" that time open my app
So please help me thanks for advance
Following my code in AndroidManifest.xml
<intent-filter>
<action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
And In Java File
String query = "";
if (getIntent().getAction() != null &&
getIntent().getAction().equals("com.google.android.gms.actions.SEARCH_ACTION) {
query = getIntent().getStringExtra(SearchManager.QUERY);
}