How to fetch data for AutoCompleteTextView in separate thread?
Posted
by
Laimoncijus
on Stack Overflow
See other posts from Stack Overflow
or by Laimoncijus
Published on 2011-01-05T20:50:48Z
Indexed on
2011/01/05
20:53 UTC
Read the original article
Hit count: 294
For my AutoCompleteTextView
I need to fetch the data from a webservice. As it can take a little time I do not want UI thread to be not responsive, so I need somehow to fetch the data in a separate thread. For example, while fetching data from SQLite DB, it is very easy done with CursorAdapter
method - runQueryOnBackgroundThread
. I was looking around to other adapters like ArrayAdapter
, BaseAdapter
, but could not find anything similar...
Is there an easy way how to achieve this? I cannot simply use ArrayAdapter
directly, as the suggestions list is dynamic - I always fetch the suggestions list depending on user input, so it cannot be pre-fetched and cached for further use...
If someone could give some tips or examples on this topic - would be great!
© Stack Overflow or respective owner