Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CursorAdapter 是否在后台线程上运行并通过 UI 循环线程发布更新?如果不是,从 ContentProvider 异步加载数据的最佳模式是什么?
更简单的方法是使用AsyncTask类。CursorAdapter不在后台线程上运行,AFAIK。
AsyncTask
CursorAdapter
CursorLoader 应该用于从 ContentProvider 异步加载数据,其中 Loaders 自动在后台线程上运行。可以在此处找到它们的指南(以及有关使用托管游标进行更新的信息) ,以及在此处使用的示例。
加载器类在 v4 支持库中可用,因此您仍然可以使用它回到 Android 2.2。