AutoCompleteTextView display items that have accent when typed without accent
I have a AutoCompleteTextView
, defined as your adapter I have a list that receives the name of cities like, for example, São Paulo, but if I inform you in the field the value Sao Paulo, without the accent, it does not display any item, that's why probably the AutoCompleteTextView
does not identify the character a == ã
.
How can I make the accented value appear when the non-accented value is typed?
Code I created separately for testing:
ArrayList<String>cidades = new ArrayList<>();
cidades.add("São Paulo");
cidades.add("São Luiz");
autoComplete = (AppCompatAutoCompleteTextView)findViewById(R.id.autoComplete);
ArrayAdapter<String> lista = new ArrayAdapter<>(this,android.R.layout.simple_dropdown_item_1line,cidades);
autoComplete.setAdapter(lista);
P.S.: I Can add the items without accent in the list easily.
1