RyanCheu
RyanCheu

Reputation: 3552

RESULT_CANCELED from RecognizerIntent every time before voice activity finishes

I'm running the following code in my onCreate of an Activity:

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
       RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Some String");
startActivityForResult(intent, VOICE_INPUT_CODE);

Before the voice activity even finishes though, I always receive a RESULT_CANCELED in the resultCode and the voice data is missing.

Thanks!

Upvotes: 0

Views: 119

Answers (1)

RyanCheu
RyanCheu

Reputation: 3552

The problem was that I had

launchMode="singleInstance" set on that activity.

Upvotes: 1

Related Questions