Efficient Lazy Loading for RecyclerView with Room
summary
Shows why SQLiteCursor’s built-in paging (a 2MB cursor window that even does a one-third overlap on reloads) causes wasted work and inconsistent views, and replaces it with the new Paging component that issues separate queries, converts rows to POJOs off the UI thread, closes cursors, and integrates with Room via a DataSourceFactory and LiveData. Uses PagedList/PagedListAdapter, DiffUtil on a background thread, prefetching, placeholders and boundary callbacks to support DB-only, network, or combined sources.
AI-written summary · about
chapters (16)
- 0:00Introduction to lazy loading
- 1:23Problems with Cursor Adapter
- 5:17Why Room needs paging
- 8:12SQLite Cursor limitations
- 15:56Avoiding SQLite Cursor issues
- 16:17Goals for Paging component
- 21:36Performance and memory goals
- 22:17Paging architecture overview
- 25:47Paging Library components
- 28:15LiveData integration
- 30:44Database updates handling
- 31:05Presentation options
- 32:57Code example walkthrough
- 37:50Automatic UI updates
- 38:12Network and database paging
- 41:02Summary and Q&A








