Receive search from Google Now

穿精又带淫゛_ 提交于 2019-12-03 09:07:55

Per the blog post, queries are in the format:

Ok Google, search pizza on Eat24

Ok Google, search for hotels in Maui on TripAdvisor

You'll note the bolded portion is the search term your app receives when a successful voice search in the correct format is sent to your app.

Also, the way we check for Intent also may be different. Only this worked for me. As the intent mentioned in the documentation is this.

Intent intent = getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction())
        || "com.google.android.gms.actions.SEARCH_ACTION".equals(intent.getAction())) {
    externalQuery = intent.getStringExtra(SearchManager.QUERY);
    //String xquery = query;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!