我看了this example它来自 Google,是 AutoCompleteTextView
上的一个适配器,可以对 API 进行网络调用以检索自动完成建议。
它不使用 AsynkTask
或线程,但不提供 StrictMode
警告,并且在没有互联网连接时不锁定 UI,我想知道为什么。
ArrayAdapter
本身是异步的吗?
最佳答案
Filtering perfomed asynchronously.
Filtering operations performed by calling
filter(CharSequence)
orfilter(CharSequence, android.widget.Filter.FilterListener)
are performed asynchronously. When these methods are called, a filtering request is posted in a request queue and processed later. Any call to one of these methods will cancel any previous non-executed filtering request.
关于android - Android 适配器是异步的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15199834/