Android isVoiceInteraction()始终返回false
我在使用VoiceInteractor时遇到了问题。这是我的主要部分:Android isVoiceInteraction()始终返回false,android,google-search,voice-interaction,Android,Google Search,Voice Interaction,我在使用VoiceInteractor时遇到了问题。这是我的主要部分: <activity android:name=".ProductSearchActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="androi
<activity android:name=".ProductSearchActivity">
<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.VOICE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
</application>
每当我使用“OK Google,search Jackes on MYCART”启动我的应用程序时,它都会启动应用程序,但isVoiceInteraction()总是返回false,GetVoiceInteraction()总是返回null,即使我使用Google search启动应用程序。有人能帮我吗?没有,我的应用程序正在启动语音搜索,它是在Google playhi dev_android中发布的应用程序,如果我们发布到play store,那么只有iVoiceInteraction()是真的?你发现了这方面的新内容吗?我在Google Play(beta测试频道)上发布了我的应用程序,但语音交互始终是错误的。不,我的应用程序正在启动语音搜索,它是在Google playhi dev_android上发布的应用程序,如果我们发布到Play store,那么只有isVoiceInteraction()是正确的?你发现了这方面的新内容吗?我在Google Play(beta测试频道)上发布了我的应用程序,但语音交互总是错误的。
@Override
public void onResume() {
super.onResume();
if (isVoiceInteraction()) {
getVoiceInteractor().submitRequest(new VoiceInteractor.PickOptionRequest(prompt, optionArr, null) {
@Override
public void onPickOptionResult(boolean finished, Option[] selections, Bundle result) {
if (finished && selections.length == 1) {
showResult(selections[0].getIndex());
}
}
@Override
public void onCancel() {
getActivity().finish();
}
});
}
}