How do I get my app to appear in Google Now's Phone Search list?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 04:37:24

问题


I want my app to be able to handle search requests from Google Now and appear in its Phone Search list, but I can't find any documentation on this. Does anyone have a link they can offer up?


回答1:


You can add your application to the Phone Search in Google Now by setting

android:includeInGlobalSearch="true"

in your searchable.xml configuration file per the Searchable Configuration reference page. Google Now shares the same phone search options as previous versions of Android, which was often called the Quick Search Box. You'll probably also want to reference the Search Suggestions for the Quick Search Box training.




回答2:


I, too, was looking for how to do this.

Turns out, adding your app to global search no longer works in KitKat and was removed in this commit: https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c




回答3:


Your searchable.xml needs to contain a few vital attributes before this will work. Simply adding the include global will not work. The sample app has a complete searchable.xml that works:

The ones that I have found to be mandatory for the search to show up in the "Phone search" list is:

android:searchSuggestAuthority

and

android:includeInGlobalSearch="true"


来源:https://stackoverflow.com/questions/15932002/how-do-i-get-my-app-to-appear-in-google-nows-phone-search-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!