Class VoiceRecognitionTrigger

  extended by

public class VoiceRecognitionTrigger
extends java.lang.Object

Triggers a voice recognition by using ImeTrigger or IntentApiTrigger.

Nested Class Summary
static interface VoiceRecognitionTrigger.Listener
Constructor Summary
VoiceRecognitionTrigger(InputMethodService inputMethodService)
Method Summary
 boolean isEnabled()
 boolean isInstalled()
 void onStartInputView()
 void register(VoiceRecognitionTrigger.Listener listener)
          Register a listener to receive a notification every time the status of Voice IME may have changed.
 void startVoiceRecognition()
          Starts a voice recognition.
 void startVoiceRecognition(java.lang.String language)
          Starts a voice recognition
 void unregister(Context context)
          Unregister the VoiceRecognitionTrigger.Listener.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public VoiceRecognitionTrigger(InputMethodService inputMethodService)
Method Detail


public boolean isInstalled()


public boolean isEnabled()


public void startVoiceRecognition()
Starts a voice recognition. The language of the recognition will match the voice search language settings, or the locale of the calling IME.


public void startVoiceRecognition(java.lang.String language)
Starts a voice recognition

language - The language in which the recognition should be done. If the recognition is done through the Google voice typing, the parameter is ignored and the recognition is done using the locale of the calling IME.
See Also:


public void onStartInputView()


public void register(VoiceRecognitionTrigger.Listener listener)
Register a listener to receive a notification every time the status of Voice IME may have changed. The VoiceRecognitionTrigger.Listener should update the UI to reflect the current status of Voice IME. When VoiceRecognitionTrigger.Listener is registered, unregister(Context) must be called when the IME is dismissed InputMethodService#onDestroy().


public void unregister(Context context)
Unregister the VoiceRecognitionTrigger.Listener.