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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:16:27+00:00 2026-05-24T03:16:27+00:00

I am developing an android application. I have an autocompleteTextView in my layout. I

  • 0

I am developing an android application. I have an autocompleteTextView in my layout. I want to populate this textView with the suggestions from my server. There are around 400 keywords on the server and they will increase in near future so i can not parse all the tags at once and then check for suggestions. The autocompleteTextView should work more like as the google search, so that i parse only when the user typed in something and that parsing happens on UI thread.

But i am here not able to trigger that parser since i am not able to get that callback method or may be the event which senses that user has typed something or may be edited some text.

setOnEditorActionListener works only when the user presses the enter button on the soft keyboard.

Thanks in advance

  • 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-24T03:16:28+00:00Added an answer on May 24, 2026 at 3:16 am

    You can use the Filter interface to implement this as well. Turns out Filter.performFiltering() is called off the UI thread just for this type of purpose. Here is some code I use to do this:

            Filter filter = new Filter() {
    
            @Override
            public CharSequence convertResultToString(Object resultValue) {
                return resultValue.toString();
            }
    
            @Override
            protected FilterResults performFiltering(CharSequence charSequence) {
                if( charSequence == null ) return null;
                try {
                    // This call hits the server with the name I'm looking for and parses the JSON returned for the first 25 results
                    PagedResult results = searchByName( charSequence.toString(), 1, 25, true);
                    FilterResults filterResults = new FilterResults();
                    filterResults.values = results.getResults();
                    filterResults.count = results.getResults().size();
                    return filterResults;
                } catch (JSONException e) {
                    return new FilterResults();
                }
            }
    
            @Override
            protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
                if( filterResults != null ) {
                    adapter.clear();
                    adapter.addAll( (List<MyObject>)filterResults.values );
                }
            }
        };
    

    Then using the Filter:

        private AutoCompleteTextView beverageName;
        ...
    
        beverageName = findViewById( R.id.beverageName );
        ListAdapter adapter = ...
        adapter.setFilter(filter);
        beverageName.setAdapter(adapter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been developing Android application where I use this code: Date d=new Date(new
I am developing an Android application where I have to maintain session. There are
I'm developing an Android application. I have a database table and I want to
I am developing an android game application,I have implemented all the screens.Now i want
I am developing an android application in which I have passed a string from
I'm developing and Android application. I have a model on Blender and I want
I am developing an android application and have created a tabbed layout for my
I am developing an android application in which I have to make a layout.I
I am developing in android application in which i have to make a layout
We've been developing an Android application which includes Google Adsense. However there seems to

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.