android - Android 适配器是异步的吗?

标签 android autocompletetextview android-adapter

我看了this example它来自 Google,是 AutoCompleteTextView 上的一个适配器,可以对 API 进行网络调用以检索自动完成建议。

它不使用 AsynkTask 或线程,但不提供 StrictMode 警告,并且在没有互联网连接时不锁定 UI,我想知道为什么。

ArrayAdapter 本身是异步的吗?

最佳答案

Filtering perfomed asynchronously.

Filtering operations performed by calling filter(CharSequence) or filter(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/

相关文章:

android - 获取屏幕上的位置以便在 View 持有者中查看

java - 删除android中链表的链表

Android:具有默认建议的 AutoCompleteTextView

android - 带监听器的自动完成-Textview

android notifyItemRangeInserted 禁用自动滚动

android - 如何从媒体存储中删除单个文件?

android - 从 Android 上的设备获取文件,在尝试使用它时一直提示未找到文件

Android AutoCompleteTextView 作为 ListView header

java - 如何在 RecyclerView 中显示 ArrayList?

Android ListView 适配器 notifyDataSetInvalidated() 与 notifyDataSetChanged()