2

I am following this youtube video right here: https://www.youtube.com/watch?v=VazSEtXHDcI

I am trying to implement google voice recognition into my application. I am using the code from that video.

After implementing this code, the google dialog box should pop up and prompt me with voice recognition:

 ButtonSpeech.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                // Specify free form input
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
                intent.putExtra(RecognizerIntent.EXTRA_PROMPT,"Please start speaking");
                intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);
                startActivityForResult(intent,1);
            }
        });

But it doesn't. When i try to click the button 'ButtonSpeech', my app will run into an error and terminate.

I can't figure out why. I am using the same code, exactly like the guy in the video.

  • Please post the `logcat` output. – activesince93 Nov 19 '15 at 06:18
  • here are the errors in the log – user5560712 Nov 19 '15 at 06:20
  • Process: test_page, PID: 2125 android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.action.RECOGNIZE_SPEECH (has extras) } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798) – user5560712 Nov 19 '15 at 06:20
  • at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512) at android.app.Activity.startActivityForResult(Activity.java:3917) at android.app.Activity.startActivityForResult(Activity.java:3877) at com..test_page.MainActivity$7.onClick(MainActivity.java:338) – user5560712 Nov 19 '15 at 06:21
  • at android.view.View.performClick(View.java:5198) at android.view.View$PerformClick.run(View.java:21147) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) – user5560712 Nov 19 '15 at 06:22
  • I found this solution: [No Activity found to handle Intent](http://stackoverflow.com/a/9481199/3110234). Hope this helps. – activesince93 Nov 19 '15 at 06:42

0 Answers0