Is there an easy way to do so?
Because dropdown with one element which is identical to typed text looks redundant.
My adapter is simple, here is the code
AutoCompleteTextView autoCompleteTextViewAddress;
...
ArrayAdapter<String> adapter = new ArrayAdapter<String>(AvatarMainActivity.this, android.R.layout.simple_list_item_1, emailsSet.toEmailStringSet());
autoCompleteTextViewAddress.setAdapter(adapter);
emailsSet.toEmailStringSet() returns set of Strings.
When I fill autoCompleteTextViewAddress with email identical to one in string set, I can still view a dropdown with one element.
Ugly solution, but it works:
Use custom class instead of original
AutoCompleteTextView.Overrided
enoughToFilterfunction hides dropdown when we have exactly one matching record in our adapter