title: Partial results using speech recognition
body: <p>I created a simple application inspired by <a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html" rel="nofollow">this example</a> in order to test all the available options (ie extra). I read about the <a href="http://developer.android.com/reference/android/speech/RecognizerIntent.html#EXTRA_PARTIAL_RESULTS" rel="nofollow"><code>EXTRA_PARTIAL_RESULTS</code> extra</a> and if I enable this option I should receive from the server any partial results related to a speech recognition. However, when I add this extra to the <code>ACTION_RECOGNIZE_SPEECH</code> intent, the voice recognition does not work anymore: the list does not display any results.</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == VOICE_RECOGNITION_REQUEST_CODE) {
          switch(resultCode) {
          case RESULT_OK:
              Log.i(TAG, "RESULT_OK");
              processResults(data);
              break;
          case RESULT_CANCELED:
              Log.i(TAG, "RESULT_CANCELED");
              break;
          case RecognizerIntent.RESULT_AUDIO_ERROR:
              Log.i(TAG, "RESULT_AUDIO_ERROR");
              break;
          case RecognizerIntent.RESULT_CLIENT_ERROR:
              Log.i(TAG, "RESULT_CLIENT_ERROR");
              break;
          case RecognizerIntent.RESULT_NETWORK_ERROR:
              Log.i(TAG, "RESULT_NETWORK_ERROR");
              break;
          case RecognizerIntent.RESULT_NO_MATCH:
              Log.i(TAG, "RESULT_NO_MATCH");
              break;
          case RecognizerIntent.RESULT_SERVER_ERROR:
              Log.i(TAG, "RESULT_SERVER_ERROR");
              break;
          default:
              Log.i(TAG, "RESULT_UNKNOWN");
              break;
          }
      }
      Log.i(TAG, "Intent data: " + data);
      super.onActivityResult(requestCode, resultCode, data);
  }
  
  private void processResults(Intent data) {
      Log.i(TAG, "processResults()");
  
      ArrayList&lt;String&gt; matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
  
      // list of results
      ListView listOfResults = (ListView)(findViewById(R.id.list_of_results));
      listOfResults.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, matches));
  
      // number of elements of above list
      TextView resultsCount = (TextView)(findViewById(R.id.results_count));
      resultsCount.setText(getString(R.string.results_count_label) + ": " + matches.size());
  }
  </code></pre>
  
  <p>When this option is enabled, the number of elements in the list of results is equal to 1 and this one result is an empty string. What is the reason for this behavior?</p>
  
  <p><strong>ADDED DETAILS</strong>
  I used the following code in order to enable <code>EXTRA_PARTIAL_RESULTS</code> option (on Android 2.3.5).</p>
  
  <pre><code>Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, ...);
  intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);
  intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 3);
  intent.putExtra(RecognizerIntent.EXTRA_PROMPT, ...);
  startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);   // where VOICE_RECOGNITION_REQUEST_CODE is a "global variable"
  </code></pre>
  
  <p>However, enabling this option, the <code>ArrayList&lt;String&gt; matches</code> in <code>processResults</code> method has only one empty element.</p>