Yes,I know there is position parametar in AdapterView.OnItemClickListener
callback, but this parametar return position of filtered(shown) list.
For example I have _countriesEvisitor
arraylist and I would like to get selected country object by looking into position like this:
public AdapterView.OnItemClickListener setOnCitizenshipAutocompleteItemClickListener(){
return (adapterView, view, position, id) -> {
CountryEvisitor citizenship=new CountryEvisitor();
citizenship=_countriesEvisitor.get(position);
_visit.setCitizenship(citizenship);
};
}
_countriesEvisitor
has 250 items, and when I start typing for example Hrvatska
I get only one item, and it has position 0 (because it is first and only one in shown list) although it is 247th in the _countriesEvisitor
list from which list autocomplete adapter is made of.
How to get selected country?