Code example for SpeechRecognizer

Methods: startListening

0
        @Override 
        public void onReceive(Context context, Intent intent) { 
            final int currentState = intent.getIntExtra(BluetoothHeadset.EXTRA_STATE, -1); 
            if (BluetoothHeadset.STATE_AUDIO_CONNECTED == currentState) { 
                //Start voice recognition 
                mRecognizer.startListening(RecognizerIntent.getVoiceDetailsIntent(context)); 
            } 
        } 
    }; 
}