title: Speech Recognition stops listening immediately
body: <p>I want to listen the first word from the user. When speech recognition starts I hear the bip-sound, but immediately I hear the stop sound. I observed that onRMSchanged is the only method where something is happening. </p>
  
  <p>This is how I use the SpeechRecognizer. I am connected to the internet when I run the application.</p>
  
  <pre><code>        Intent speechintent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
          speechintent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS , 1000);
          speechintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,  RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
          speechintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en");
  
          SpeechRecognizer speechRecognizer = SpeechRecognizer.createSpeechRecognizer(Inference.getmContext());
          speechRecognizer.setRecognitionListener(new RecognitionListener() {
              @Override
              public void onReadyForSpeech(Bundle params) {
  
              }
  
              @Override
              public void onBeginningOfSpeech() {
              Log.i("beg", "beg");
              }
  
              @Override
              public void onRmsChanged(float rmsdB) {
                  Log.i("on rms changed", "rms changed");
              }
  
              @Override
              public void onBufferReceived(byte[] buffer) {
                  Log.i("ANSWER","END");
              }
  
              @Override
              public void onEndOfSpeech() {
                  Log.i("ANSWER","END");
              }
  
              @Override
              public void onError(int error) {
  
              }
  
              @Override
              public void onResults(Bundle results) {
  
                 Log.i("ANSWER",results.getString(RecognizerIntent.EXTRA_RESULTS));
                  ArrayList&lt;String&gt; result = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
  
              }
  
              @Override
              public void onPartialResults(Bundle partialResults) {
                  Log.i("ANSWER",partialResults.getString(RecognizerIntent.EXTRA_RESULTS));
              }
  
              @Override
              public void onEvent(int eventType, Bundle params) {
  
              }
          });
  
          speechRecognizer.startListening(speechintent);
          Handler handler = new Handler();
          handler.postDelayed(new Runnable() {
              @Override
              public void run() {
                  speechRecognizer.stopListening();
              }
          }, 1000);
  </code></pre>
  
  <p>I do not know why it doesn't let me speak.</p>
  
  <p>UPDATE:</p>
  
  <p>This is the order it goes through the methods:</p>
  
  <pre><code>onRmsChanged
  onReadyForSpeech
  onError
  </code></pre>
  
  <p>onError I get the error code 2, that means Network Error, but I already set the Google Text To speech, I put <code>INTERNET</code> and <code>RECORD_AUDIO</code> permissions in Manifest and I am connected to the internet. I do not understand what is wrong?</p>