title: Start speech recognition thru voice with phrase like "Ok Google"?
body: <p>I'm building an app that uses Voice Commands to perform certain functions. I got some codes working from <a href="http://developer.android.com/training/wearables/apps/voice.html">here</a></p>
  
  <pre><code>private static final int SPEECH_REQUEST_CODE = 0;
  
  // Create an intent that can start the Speech Recognizer activity
  private void displaySpeechRecognizer() {
      Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
      intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
              RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  // Start the activity, the intent will be populated with the speech text
      startActivityForResult(intent, SPEECH_REQUEST_CODE);
  }
  
  // This callback is invoked when the Speech Recognizer returns.
  // This is where you process the intent and extract the speech text from the intent.
  @Override
  protected void onActivityResult(int requestCode, int resultCode,
          Intent data) {
      if (requestCode == SPEECH_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {
          List&lt;String&gt; results = data.getStringArrayListExtra(
                  RecognizerIntent.EXTRA_RESULTS);
          String spokenText = results.get(0);
          // Do something with spokenText
      }
      super.onActivityResult(requestCode, resultCode, data);
  }
  </code></pre>
  
  <p>However, this approach needs to be activated through a button click. Is there a way to start the speech recognizer thru a voice command as well? Like Google Now where you can just say "Ok Google", then it will open up the Speech Recognizer activity and listen for commands?</p>
  
  <p>Thanks.</p>