title: How to override voice input key on Android keyboard?
body: <p>I created an Activity with a button, which when clicked, starts an Intent to launch the voice input as follows:</p>
  
  <pre><code>Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak Now");
  startActivityForResult(intent, SPEECH_REQUEST_CODE);
  </code></pre>
  
  <p>Then, I get the results and display them in a dialog so that the user can select the closest match.</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == SPEECH_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK &amp;&amp; data != null) {
          final ArrayList&lt;String&gt; list_voice_input = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
          // I use this ArrayList to create a dialog.
      }
      super.onActivityResult(requestCode, resultCode, data);
  }
  </code></pre>
  
  <p>So the Activity works as follows: Click the button, speak, and then a dialog pops up listing the closest matches and you can select one.</p>
  
  <p>I have used a button-click to implement this. But Android's keyboard already has inbuilt voice input. When I use it to speak, it types out what I am saying, automatically detecting the closest match.</p>
  
  <p><strong>What I need:</strong></p>
  
  <p>I wish to make use of the default keyboard instead of a button, detecting when the user has chosen to speak instead of type (in a text field), and display a dialog box with the closest matches.</p>
  
  <p>Any ideas on how I can do this?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>My question was marked as a duplicate, but I am not trying to get rid of the pop-up dialog that comes when you are recording your voice. My question is different.</p>
  
  <p>When you are typing text, in the Android keyboard, there is a voice input option already inbuilt. You can use that to speak text. So, my question is, instead of automically printing out the closest match, can I show the user a list of closest matches in a dialog and ask them to select one?</p>