Immediately show autocomplete on Android

Mitchell picture Mitchell · Nov 20, 2010 · Viewed 12.6k times · Source

The Android autocomplete only starts after two letters. How can I make it so the list appears when the field is just selected?

Answer

Heinrisch picture Heinrisch · Feb 26, 2013

To get the autocomplete to show on focus add focus listener and show the drop down when the field gets focus, like this:

editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
  @Override
  public void onFocusChange(View view, boolean hasFocus) {
    if(hasFocus){
      editText.showDropDown();
    }
  }
});

Or just call editText.showDropDown() if you don't need the focus part.