How can I trigger the com.google.android.gms.actions.SEARCH_ACTION Google Now action for testing?

穿精又带淫゛_ 提交于 2019-12-04 09:34:25

问题


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. 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.? 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>

回答1:


Yes, you can use adb activity manager to trigger the activity using the syntax below:

adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION -e query foo <app package name here>



来源:https://stackoverflow.com/questions/26824604/how-can-i-trigger-the-com-google-android-gms-actions-search-action-google-now-ac

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