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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:17:18+00:00 2026-05-31T05:17:18+00:00

In Android AutoCompleteTextView only show show dropdown when we entered first letter correctly .What

  • 0

In Android AutoCompleteTextView only show show dropdown when we entered first letter correctly .What I want is when I enter any letter sequence in the string available it should show the drop down.for example “January” is in my array so when i enter “anu” in AutoComplete field it should show “january” in drop down.Please help.
Thank You

  • 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-31T05:17:19+00:00Added an answer on May 31, 2026 at 5:17 am

    You are likely going to have write your own Filter and attach it via a TextWatcher. This response has an example of regex in an AutoCompleteTextView: Android AutoCompleteTextView with Regular Expression? and here is another regex/java example: How can I perform a partial match with java.util.regex.*?

    EDIT: You will need to extend ArrayAdapter in order to override getFilter() and return your custom filter.

    So you are going to have something like this:

    autoCompleteTextView.setAdapter(arrayAdapter);
    autoCompleteTextView.addTextChangedListener(new TextWatcher() {
       public void onTextChanged(CharSequence s, int start, int before, int count) {
          arrayAdapter.getFilter().filter(s);
       }
    });
    
    public class RegexFilter extends Filter{
    
       ArrayAdapter<String> mAdapter;
       public RegexFilter(ArrayAdapter<String> adapter) {
          mAdapter = adapter;
       }
    ...
       @Override
       protected FilterResults performFiltering(CharSequence constraint) {
          Pattern p = Pattern.compile(constraint);
          Matcher m = p.matcher("");
          List listOfMatches = new ArrayList<String>();
          for (String curMonth : months) {
             m.reset(curMonth);
             if (m.matches || m.hitEnd()) {
                listOfMatches.add(curMonth);
             }
          }
          FilterResults results = new FilterResults();
          results.values = listOfMatches;
          results.count = listOfMatches.size();
          return results;
       }
    
       @Override
       protected void publishResults(CharSequence constraint, FilterResults results) {
          mAdapter.addAll(results.values);
          mAdapter.notifyDataSetChanged();
       }
    }
    
    public class PartialArrayAdapter extends ArrayAdapter<String> {
       ...
       RegexFilter mFilter;
       @Override
       public TimedSuggestionFilter getFilter() {
          if(null == mFilter)
             mFilter = new RegexFilter(this);
          return mFilter;
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know if this is possible using Android's XML: I have AutoCompleteTextView
I used an AutoCompleteTextView in my android app and it is working correctly. The
I am selecting text for AutoCompleteTextView.After i want apply setonclicklistener to selected text.if any
Android application should show Events happening in city as per day/month/year anywhere in the
Android newbie here. I'm using this tutorial to show some rows that I fetch
I'm developing a map application in Android. I'm using Google maps API to show
I want the dropdown of my auto complete TextView to cover the entire screen
I'm using Android's AutoCompleteTextView with a CursorAdapter to add autocomplete to an app. In
ANDROID: Wanted to know whether is there any API or workaround to know that
I have a long list of words and I want to show words starting

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.