Here is my scenario: I’ve got a database, where 2 columns are interesting for me. I now created an autocompletetextview where the adapter gehts via SQL the entries of one column.
So far… so good, but what i actually want is, that if the user types sth. into the autocompletefield i notice this and fetch the text. Via SQL I now want to get everey Entry of column 2 where the value of column 1 is contained in the entered text. And this List should be displayed in the adapter. In other words I filter the data by myself via sql but i want them to be shown in the adapter.
The problem is, that the adapter only shows the entries which start with the text in the autocompletefield but I want to show the adapter anytime, as already saied: I filter the data by myself I just want the adapter to display them.
Any ideo how to solve this? Is the AutocompleteTextView the right item to use?
I also thought about using a simple Spinner… but when using a spinner there are 2 main problems. first I would have to make him editable. and second I would need a dropdown instead of the “popup”. …
Another idea of mine to solve this issue is to write an own filter for the autocomplete field… but i’ve never down this so far and I also couldn’t found any examples in the internet to do so.
thanks for your help
I changed the ArrayAdapter method of spinner and i got my custom Spinner.
just change the parameter of this method like
In Which the mylayout file contains