Java 从android中的SpeechRecognition服务启动另一项活动?
我正在开发android应用程序,它可以识别声音并将声音转换为文本作为后台流程,目前运行良好,但我的下一步是打开不同的内置活动,如消息、画廊、电子邮件摄像头, 我的代码是Java 从android中的SpeechRecognition服务启动另一项活动?,java,android,speech-recognition,voice-recognition,voice,Java,Android,Speech Recognition,Voice Recognition,Voice,我正在开发android应用程序,它可以识别声音并将声音转换为文本作为后台流程,目前运行良好,但我的下一步是打开不同的内置活动,如消息、画廊、电子邮件摄像头, 我的代码是 public void onResults(Bundle b) { ArrayList<String> as = b .getStringArrayList(sr.RESULTS_RECOGNITION); String res
public void onResults(Bundle b) {
ArrayList<String> as = b
.getStringArrayList(sr.RESULTS_RECOGNITION);
String res = "";
for (int i = 0; i < as.size(); i++) {
Log.e("OnResult", as.get(i));
res += as.get(i);
}
if (res.equalsIgnoreCase("message")) {
Intent i = new Intent(Intent.ACTION_SEND);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(i);
}
}
public void onResults(Bundle b){
ArrayList as=b
.getStringArrayList(高级结果识别);
字符串res=“”;
对于(int i=0;i
我在这方面有个例外:(
如果有人能帮我,我将不胜感激,peace,到底是什么异常?请记住始终提供异常文本和stacktrace。我在上面添加了图片,最好粘贴文本而不是图片。图片不完整。您遗漏了上面的几行重要内容。