【发布时间】:2014-11-09 05:35:04
【问题描述】:
我正在尝试使用我的AndroidManifest.xml 中的这段代码将 Google Now SEARCH_ACTION 与我的可搜索活动联系起来:
<activity android:name=".SearchableActivity">
<intent-filter>
<action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
我正在按照http://android-developers.blogspot.com/2014/10/the-fastest-route-between-voice-search.html 和https://developer.android.com/guide/components/intents-common.html#SearchOnApp 的说明进行操作。
这只是行不通。来自 Google Now 的搜索没有启动我的应用程序。我已验证:
- 这适用于 Eat 24 应用,确认操作系统/Google 应用/区域设置的正确版本没有问题。
- 我可以从我的应用程序内部启动应用程序并接收输入的搜索查询,确认我的
SearchableActivity代码没有任何问题。
有人让这个工作吗?你能告诉我我在这里缺少什么吗?
【问题讨论】:
标签: android google-search