Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7701955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:06:57+00:00 2026-05-31T23:06:57+00:00

I created a simple application inspired by this example in order to test all

  • 0

I created a simple application inspired by this example in order to test all the available options (ie extra). I read about the EXTRA_PARTIAL_RESULTS extra 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 ACTION_RECOGNIZE_SPEECH intent, the voice recognition does not work anymore: the list does not display any results.

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<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

    // list of results
    ListView listOfResults = (ListView)(findViewById(R.id.list_of_results));
    listOfResults.setAdapter(new ArrayAdapter<String>(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());
}

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?

ADDED DETAILS
I used the following code in order to enable EXTRA_PARTIAL_RESULTS option (on Android 2.3.5).

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"

However, enabling this option, the ArrayList<String> matches in processResults method has only one empty element.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:06:58+00:00Added an answer on May 31, 2026 at 11:06 pm

    I suggest not relying on PARTIAL_RESULTS because the Google documentation says this:
    The server may ignore a request for partial results in some or all cases.

    In my experience, Google almost always ignores requests for partial results.

    However, I don’t believe that setting EXTRA_PARTIAL_RESULTS should stop normal EXTRA_RESULTS from being returned. It should just have no effect. I have tested this in my code and adding EXTRA_PARTIAL_RESULTS doesn’t change the output.

    Also, unless you are using SpeechRecognizer, Android won’t send you those error codes.

    To see that EXTRA_PARTIAL_RESULTS does not interfere with the results. Get the code from here then add the extra within this method:

    private void sendRecognizeIntent()
    {
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say the magic word");
        intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 100);
        startActivityForResult(intent, SPEECH_REQUEST_CODE);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a simple application which will read all the files and folders kepts
I've created a very simple Enterprise Application project with about 7 entity beans and
i created a simple application , and i read in a book that the
I created a simple WCF application which expose one operation. This operation takes a
I have created a simple application in android [PhoneGap] [Eclipse] {Sorry for this convention
I have created a simple web application, for which I want all responses with
I've created my simple application. When I list all files and directories from .
I created a simple test application to perform translation ( T ) and rotation
I've created a simple desktop application in C# 3.0 to learn some C#, wpf
I've created a simple Flex application to fetch an XML file. I need a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.