以下是Paging分頁庫加載Room數據的Java代碼github地址:
https://github.com/mayangming/PagingWithRoomJavaSample
注意:
1、arch版本中的LivePagedListProvider類被移除了,替換成了LivePagedListBuilder。所以數據庫中不能直接返回LivePagedListProvider,需要返回DataSource
參考鏈接:
https://developer.android.google.cn/topic/libraries/architecture/paging