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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:59:53+00:00 2026-06-04T15:59:53+00:00

I add TextChangedListener to AutocompleteTextView . In TextChangedListener ‘s afterTextChanged() I invoke AsyncTask which

  • 0

I add TextChangedListener to AutocompleteTextView. In TextChangedListener‘s afterTextChanged() I invoke AsyncTask which loads data from web (loading all the data when activity starts is not an option because lists can be pretty large, so it becomes just waste of traffic).
AsyncTask‘s onPostExecute() looks like that (I use ArrayAdapter):

    @Override
    protected void onPostExecute(ArrayList<Subregion> result)
    {
        super.onPostExecute(result);
        if (result != null)
        {
            adapter.clear();
            for (Iterator<Subregion> iterator = result.iterator(); iterator.hasNext();)
            {
                Subregion subregion = iterator.next();
                adapter.add(subregion);
            }
            adapter.notifyDataSetChanged();
            autocompleteTextView.showDropDown();
        }
    }

Subregion is my custom object with overriden toString().
I want my program to start loading data when user starts typing and show results at once they are received and parsed.

My problem:

autocompleteTextView.showDropDown() has no effect. onPostExecute() receives correct list of data, they are added to adapter, but showDropDown() doesn’t show the dropdown. What’s the matter?

  • 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-06-04T15:59:54+00:00Added an answer on June 4, 2026 at 3:59 pm

    I am doing the exact same thing, and I just achieved this functionality.
    Instead of clearing the adapter and building it individually, set the adapter as below(I do this in a function which is called in the onPostExecute);

    //suggestions is a string array of suggestions.
    suggestAdapter = new ArrayAdapter<String>(this, R.layout.suggestions, suggestions);
    //The autocomplete view 
    suggestions.setAdapter(this.suggestAdapter);
    suggestAdapter.notifyDataSetChanged();
    

    You do not need to explicitly call showdropdown, the autocomplete view is automatically updated when the adapter notifies it that data has been changed.

    You also can call

    adapter.setNotifyOnChange(true)
    

    which makes it unnecessary to call

    adapter.notifyDatasetChanged()
    

    See setNotifyOnChange
    Hope I could be of help.

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

Sidebar

Related Questions

I'm trying to add a TextWatcher editbox.afterTextChanged listenering to my Main activity where I
I add this code in my activity public boolean onKeyDown(int keyCode, KeyEvent event) {
I am doing a login Activity which basically has an EditText and two Buttons
I'm using an AutoCompleteTextView to suggest user some words from my sqlite db as
To add a whitespace seperator in a string we use String.Join(). My question:What(and how)
I add my page top link button like this: <a name=top></a> . . .
I add a label on to the view UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10.0f,
I add many check boxes to the excel sheet programaticaly using the following code:
I add this class to library/My/Validate/PasswordConfirmation.php <?php require_once 'Zend/Validate/Abstract.php'; class My_Validate_PasswordConfirmation extends Zend_Validate_Abstract {
I add asp.net file upload control as follows: <asp:FileUpload ID=filesFileUpload runat=server /> <asp:RegularExpressionValidator ID=RegularExpressionValidator3

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.