How to create AutoCompleteTextView which will fetch results from remote server?
As I understand I need to implement ArrayAdapter, which must make async requests to server.
AutoCompleteTextView
i not meant for this kind of action, i once thought like you and made very bad code with that...
if your auto complete list comes from he network based on every character you input, you better off create a Vertical Linear Layout which contains an EditText and a listView, and create a connection pool.
for every key type check if it was typed in 100-130 ms to make sure the user is likely to wait for a response and issue a request, on any new request, remove or invalidate the last request u've sent.
one response safely arrives , update your list adapter.
works smoothly for me.
AutoCompleteTextview uses a pre made list. it uses AsyncTask itself so i'ts pretty bad to use one yourself to update the list it uses...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With