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 7037921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:36:12+00:00 2026-05-28T01:36:12+00:00

I need the results from recognizer to be a string.. when i use this

  • 0

I need the results from recognizer to be a string.. when i use this code i get eclipse error ‘cannot convert Array as string..

code: final ArrayList<String> results2 = data.getStringArrayListExtra    (RecognizerIntent.EXTRA_RESULTS);

also tried, with no luck:

final String results2 = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

still says error..

Is this enough info?? Thank you in advance.

NEW: I added this code, but i want a .get that will store this word/text in acceptable manner for a cursor usage:

String[] matches = data.getStringArrayExtra(SpeechRecognizer.RESULTS_RECOGNITION);

Eclipse does not error , but my result is coming out as ‘null’ so i just need a .Get that works in my scenario?? Than kyou all for helping also!

  • 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-28T01:36:13+00:00Added an answer on May 28, 2026 at 1:36 am

    you code should work fine. See this snippet:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        Intent i = getIntent();
        final ArrayList<String> stringArrayListExtra = i.getStringArrayListExtra("hello");
    }
    

    What you can look is:

    • check for your java version. Do you have java 1.5 (or higher but I am not very confortable with 1.7 yet) configured. The reason this that generics are added in 1.5.
    • Try cleaning and rebuilding your project by choosing Project > Clean.

    I can’t see any other

    Edit: Since there is not enough code to look into, you can yourself look into speech sample here

    If look there:

    /**
     * Handle the results from the recognition activity.
     */
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {
            // Fill the list view with the strings the recognizer thought it could have heard
            ArrayList<String> matches = data.getStringArrayListExtra(
                    RecognizerIntent.EXTRA_RESULTS);
            mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
                    matches));
        }
    
        super.onActivityResult(requestCode, resultCode, data);
    }
    

    They are using RecognizerIntent.EXTRA_RESULTS. Try this sample if it resolves your issue. As now your issue is different then what i look initially.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get Google search results from inside a program? I need to
I need a variable to hold results retrieved from the database. So far this
I need to get only 1 record from sql result. we use SELECT TOP
For some reason I'm stuck on this. I need to filter results from a
I have a few tables wich I need to get results from into one
So say I'm getting results from my core data request: (this is example code)
I have need to return multiple results from a subquery and have been unable
I need a regex that will give me the following results from each example
How can I get result from action? I need to show the commentID on
I've got a reasonably simple query (this time) that I need ALL the results

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.