Reputation: 63
I have recently discovered the CursorLoader class from Udacity course but when I headed towards the google doc I realized that it has been deprecated. So now I want to know what are it's alternative also I haven't understand the role of this class so can anyone explain this? Thanks in advance.
Upvotes: 0
Views: 231
Reputation: 1218
LiveData and ViewModel replace CursorLoaders
actually, ViewModel handles survival across config change, and LiveData replaces the Loader data loaded callbacks, but they don't for example replace the cursor-based loading mechanism that allows loading large data sets in a lazy manner.
The actual replacement for that will be the new DataSource API in the Paging library which is currently alpha4. Then, CursorLoader will be replaced by LivePagedListBuilder, and just PagedList in general, with RecyclerView integration through PagedListAdapter.
Upvotes: 1