[英]How can I trigger the com.google.android.gms.actions.SEARCH_ACTION Google Now action for testing?
I am building an Android app and would like to integrate the ability to search using voice with Google Now Actions as described in this blog post .我正在构建一个 Android 应用程序,并希望将使用语音搜索的功能与本博客文章中所述的 Google Now Actions 集成。 Before I push the app to the Play Store, is there a way to test my intent filter (
com.google.android.gms.actions.SEARCH_ACTION
), search expression handling, etc.?在我将应用推送到 Play 商店之前,有没有办法测试我的意图过滤器(
com.google.android.gms.actions.SEARCH_ACTION
)、搜索表达式处理等? I've followed the documentation and included the intent filter as below:我遵循了文档并包含了如下意图过滤器:
<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>
Yes, you can use adb
activity manager to trigger the activity using the syntax below:是的,您可以使用
adb
活动管理器使用以下语法触发活动:
adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query foo < app package name here >
adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query foo <此处的应用程序包名称>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.