Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android OK Google搜索操作会导致isVoiceInteraction()始终返回false_Android_Google Voice Actions - Fatal编程技术网

Android OK Google搜索操作会导致isVoiceInteraction()始终返回false

Android OK Google搜索操作会导致isVoiceInteraction()始终返回false,android,google-voice-actions,Android,Google Voice Actions,在中,使用以下意图过滤器定义活动(请参见步骤6): 在我自己的应用程序中,我已将以下意图过滤器添加到我的语音搜索活动中: <intent-filter> <action android:name="com.google.android.gms.actions.SEARCH_ACTION" /> <category android:name="android.intent.category.DEFAULT" /> <category

在中,使用以下意图过滤器定义活动(请参见步骤6):

在我自己的应用程序中,我已将以下意图过滤器添加到我的语音搜索活动中:

<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中未正确设置此类别,
Activity.isVoiceInteraction()
Activity.isVoiceInteractionRoot()
都返回
false

有人能解释为什么会发生这种情况吗


谢谢

您好,看来您必须将您的应用程序发布到Google Play,以便Google能够在查询中索引和识别您的应用程序。更多的信息在这篇文章中:在这个问题上我的头撞了几个小时;想知道为什么
isVoiceInteraction()
总是错误的。谷歌文档没有提到在成功测试之前需要为你的应用程序编制索引。玩得不好的谷歌。@anticafe你发布的链接不再有效。请更新和/或提交包含更多详细信息的问题答案
02-26 15:32:42.423 779-6923/? I/ActivityManager: START u0 {act=android.media.action.STILL_IMAGE_CAMERA cat=[android.intent.category.VOICE] flg=0x18000000 pkg=com.example.android.voicecamera cmp=com.example.android.voicecamera/.TakePictureActivity (has extras)} from uid 10027 on display 0
<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>
02-26 16:17:26.722 779-14786/? I/ActivityManager: START u0 {act=com.google.android.gms.actions.SEARCH_ACTION pkg=com.my.pkg cmp=com.my.pkg/.activity.VoiceSearchActivity (has extras)} from uid 10027 on display 0