找不到用于处理Intent的活动{act = android.speech.action.RECOGNIZE_SPEECH(有其他功能)} [英] No Activity found to handle Intent { act=android.speech.action.RECOGNIZE_SPEECH (has extras) }

查看:154
本文介绍了找不到用于处理Intent的活动{act = android.speech.action.RECOGNIZE_SPEECH(有其他功能)}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码中引发了异常:

The exception was thrown in the following code:

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);.

我已经在Google上搜索了,发现这是因为语音搜索应用我正在使用的设备上缺少谷歌.我可以通过手动安装应用程序来解决问题,但是如何以编程方式安装apk,例如导入一些库或其他文件?
非常感谢.

I've googled and found that it's because of the voice search app from google is missing on the device I am using. and I could solve the problem by installing the app manually, but how could I get the apk installed programly, like import some library or other~
Thanks a lot.

推荐答案

在网络视图中打开应用程序(要使用)的链接

open link of the application(which you want to use) in web view

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);

}

将APP_PACKAGE_NAME替换为 https://market.android.com/details?id=APP_PACKAGE_NAME带有市场上语音识别应用程序包的名称

replace APP_PACKAGE_NAME in https://market.android.com/details?id=APP_PACKAGE_NAME with the voice rcognition applicatio package name on market

这篇关于找不到用于处理Intent的活动{act = android.speech.action.RECOGNIZE_SPEECH(有其他功能)}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆