diff options
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 4d50de1..ee55f6d 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -2895,11 +2895,18 @@ public class Controller @Override public void startVoiceRecognizer() { - Intent voice = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); - voice.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, - RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); - voice.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); - mActivity.startActivityForResult(voice, VOICE_RESULT); + try{ + Intent voice = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); + voice.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, + RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); + voice.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); + mActivity.startActivityForResult(voice, VOICE_RESULT); + } + catch(android.content.ActivityNotFoundException ex) + { + //if could not find the Activity + Log.e(LOGTAG, "Could not start voice recognizer activity"); + } } @Override |