android - 找不到处理 Intent { act=android.speech.action.RECOGNIZE_SPEECH(有附加功能)} 的 Activity

标签 android google-voice

异常在以下代码中抛出:

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
      RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");
startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);.

我用谷歌搜索发现这是因为 the voice search app我正在使用的设备上缺少来自 google 的内容。我可以通过手动安装应用程序来解决问题,但是我怎么才能通过程序安装 apk,比如导入一些库或其他~
非常感谢。

最佳答案

在 WebView 中打开应用程序(您要使用的)的链接

作为

try{
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
      RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");
startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);.
}
catch(ActivityNotFoundException e)
{
Intent browserIntent = new Intent(Intent.ACTION_VIEW,   Uri.parse("https://market.android.com/details?id=APP_PACKAGE_NAME"));
startActivity(browserIntent);

}

替换 https://market.android.com/details?id=APP_PACKAGE_NAME 中的 APP_PACKAGE_NAME市面上的语音识别应用包名

关于android - 找不到处理 Intent { act=android.speech.action.RECOGNIZE_SPEECH(有附加功能)} 的 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9479846/

相关文章:

java - 应用程序的 PagerAdapter 更改了适配器的内容,但未调用 notificationDataSetChanged()

javascript - 如何在 Android webview 中通过 ID 捕获元素点击?

java - 如何从 Android Studio 上的 txt 文件中获取一行

Android - 语音识别和保存音频文件 - 在某些设备上不工作

ajax - 如何提取 Google 语音数据?

ios - 在 iOS 上调用电话的完整谷歌语音网址是什么?

android - 背景样式未显示在进度条上

android - 带章节标题的 ListView

python noob 在发送谷歌语音文本时遇到问题