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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:19:36+00:00 2026-05-20T07:19:36+00:00

This one should be pretty simple. The use case is that I have a

  • 0

This one should be pretty simple. The use case is that I have a ListView generated by the results of a voice search. Once the user selects the appropriate item from the list, I want the list to disappear. This list (its contents) will not be needed again. I know this can be done in a number of ways, but I am not experienced enough to know which is best (quickest, most efficient with mobile resources…etc.) I have used clearChoices(), setVisibility(2) ‘Gone’. Anyway I thought I would go to the source for a proper answer.

Thanks as always for your help. Here is the relevant code, if you like:

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {

        mList = (ListView) findViewById(R.id.list);

        ArrayList<String> matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
        mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, matches));

        mList.setTextFilterEnabled(true);

        mList.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String description = ((TextView) view).getText().toString();
                final EditText etDesc = (EditText) findViewById(R.id.EditDescription);

                etDesc.setText(description);
                mList.setVisibility(2);
            }
        });
    }
}   
  • 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-20T07:19:37+00:00Added an answer on May 20, 2026 at 7:19 am

    Well, I don’t know exactly what is what you are trying to accomplish.
    You can solve this by creating a Dialog containing the list, and you can either dismiss the Dialog as soon as they press the item, or you can do it with an “Ok” button.

    Also you can separate your activity into two, and whenever the item is selected from the list, you finish the activity and go back to the previous activity.

    Another solution, is that once the item is selected then you do mList.setVisibility(View.Gone) (or View.Invisible depending on what you want to accomplish).

    Any of these solutions can work, and you would have to decide what works best for the logic of your app.
    I hope that helps

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

Sidebar

Related Questions

In this thread some one commented that the following code should only be used
Has any one done this before? It would seem to me that there should
This should hopefully be a simple one. I would like to add an extension
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
This one is a case of not doing your homework.:-) Apart from dynamic loading
This one will take some explaining. What I've done is create a specific custom
This one has me kind of stumped. I want to make the first word
This one has been bugging me for a while now. Is there a way
This one has me scratching my head. I'm running Subversion 1.3.1 (r19032) on Ubuntu.
This one is a bit tedious in as far as explaining, so here goes.

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.