我无法在com.google.android.gms.actions.SEARCH_ACTION
已发布到 Google Play(私人频道)并下载到手机上的应用程序上成功使用 Google 系统语音操作“在应用程序中搜索”( )。
MainActivity
在匹配意图过滤器后,将传递来自搜索操作的额外查询的意图。
在发布应用程序之前,我已经使用以下adb
命令测试了该应用程序,它运行良好:
adb shell am start -a "com.google.android.gms.actions.SEARCH_ACTION" --es query "[query]" -n "com.testapp/.MainActivity"
下面是我的 Android 清单,其中包含意图过滤器:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testapp" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".app.AppController"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:allowTaskReparenting="true">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:exported="true"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
<meta-data
android:name="android.app.default_searchable"
android:value=".MainActivity" />
</activity>
</application>
</manifest>
我的谷歌语音操作所需的意图过滤器是否设置正确?如果是,为什么使用谷歌应用程序在我的应用程序中搜索关键字不起作用?或者是否有任何其他考虑因素,例如(仅个人猜测):Google App“缓存/处理”应用程序内容/意图过滤器等所需的时间,应用程序名称和搜索关键字不够“唯一”,或者事实该应用程序被分发到私人频道而不是?
希望之前成功实施 Google Voice Actions 的任何人分享并提供一些意见。