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

  • Home
  • SEARCH
  • 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 7613017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:03:56+00:00 2026-05-31T02:03:56+00:00

I am using the code from google’s sample voice recognition class. They write the

  • 0

I am using the code from google’s sample voice recognition class. They write the top 5 results into a listview but I just want the top result posted in an edittext field. Is this possible? Or is it possible to populate the listview but then automatically copy the results to an edittext field?

Any help would be appreciated.

  • 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-31T02:03:57+00:00Added an answer on May 31, 2026 at 2:03 am

    If you only want 1 result back, you should specify it in the intent you use to start the Voice Recognition Activity:

    private void startVoiceRecognitionActivity() {
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    
        intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());
    
    
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        //since you only want one, only request 1
        intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
    
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en-US");
    
        startActivityForResult(intent, 1234);
    }
    

    And then pull the single result and set it to your EditText:

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == Activity.RESULT_OK){
            //pull all of the matches
            ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
    
            String topResult = matches.get(0);
            EditText editText = findViewById(R.id.yourEditText);
            editText.setText(topResult);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery version 1.7.1 from Google CDN and have the following code: $(menuInstance).delay(2000).removeClass('loading').html(ul);
I am using the control library from http://code.google.com/p/gong-wpf-dragdrop/successfully for my listbox dragging operation.But there
I am using the api twitterizer2 downloaded from http://code.google.com/p/twitterizer/downloads/list but when I try to
My main solution is using code from a utility class library, that I wrote
I'm using the the HTML5Shiv from google code on my site. I'm including it
When I try to download a project from Google Code using TortoiseHg I got
I would like to check out code from google code using the source, http://imedia.googlecode.com/svn/trunk/imedia-read-only
I'm using some code to extract from a Google Url the keyword of the
i am using tortoise svn client to download code from code.google.If protocol is http
I am trying to download a source code from code.google.com using git command but

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.