com.google.android.voiceime
Class VoiceRecognitionTrigger

java.lang.Object
  extended by com.google.android.voiceime.VoiceRecognitionTrigger

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

VoiceRecognitionTrigger

public VoiceRecognitionTrigger(InputMethodService inputMethodService)
Method Detail

isInstalled

public boolean isInstalled()

isEnabled

public boolean isEnabled()

startVoiceRecognition

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.


startVoiceRecognition

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

Parameters:
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:
InputMethodSubtype

onStartInputView

public void onStartInputView()

register

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().


unregister

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