title: Recognition Listener not listen
body: <p>I created this service to listen in the background, career service, but do not know if the listener listen or not, yet only show in  the Logcat message when the service starts ... I have read others questions in stackoberflow but anything run in my case.</p>
  
  <pre><code>public class ServicioVoz extends RecognitionService {
  
  private SpeechRecognizer sr;
  private VoiceResultsListener vrl;
  public Principal principal;
  
  @Override
  public void onCreate() {
      super.onCreate();
      Log.i("Dins del servei", "Arrancat");
  }
  
  @Override
  public void onDestroy() {
      super.onDestroy();
      Log.i("SimpleVoiceService", "Service stopped");
  }
  
  @Override
  protected void onCancel(Callback listener) {
      sr.cancel();
  }
  
  @Override
  protected void onStartListening(Intent recognizerIntent, Callback listener) {
      Log.e("escoltant", "________________________________");
      sr.setRecognitionListener(new VoiceResultsListener(listener));
      sr.startListening(recognizerIntent);
  }
  
  @Override
  protected void onStopListening(Callback listener) {
      sr.stopListening();
      Log.e("Atura d'escoltar", "________________________________");
  }
  
  /* INICIALIZAMOS UNA NUEVA CLASE*/
  private class VoiceResultsListener implements RecognitionListener {
  
      private Callback UserListener;
  
      public VoiceResultsListener(Callback userSpecifiedListener) {
          UserListener = userSpecifiedListener;
      }
  
      @Override
      public void onBeginningOfSpeech() {
          try {
              UserListener.beginningOfSpeech();
          } catch (RemoteException e) {
              e.printStackTrace();
              Log.e("ERROR", "No comença ha escoltar");
          }
      }
  
      @Override
      public void onBufferReceived(byte[] buffer) {
          try {
              UserListener.bufferReceived(buffer);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void onEndOfSpeech() {
          try {
              UserListener.endOfSpeech();
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void onError(int error) {
          try {
              UserListener.error(error);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void onEvent(int eventType, Bundle params) {
          ;
      }
  
      @Override
      public void onPartialResults(Bundle partialResults) {
          try {
              UserListener.partialResults(partialResults);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void onReadyForSpeech(Bundle params) {
          try {
              UserListener.readyForSpeech(params);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void onResults(Bundle results) {
          Log.e("resultats", "nose que possar");
          try {
              UserListener.results(results);
              ArrayList&lt;String&gt; matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
              String text = "";
              for (String result : matches)
                  text += result + "\n";
  
              Log.e("", text);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  
      @Override
      public void onRmsChanged(float rmsdB) {
          try {
              UserListener.rmsChanged(rmsdB);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>}</p>