【发布时间】:2018-11-06 12:52:35
【问题描述】:
在我的 ViewModel 中,我使用
加载数据private val pagingConfig = PagedList.Config.Builder()
.setEnablePlaceholders(false)
.setInitialLoadSizeHint(INITIAL_LOAD_SIZE_HINT)
.setPageSize(PAGE_SIZE)
.build()
val notificationList = LivePagedListBuilder<Long, Notification>(dataSourceFactory, pagingConfig).build()
效果很好。但是,当我的数据发生变化时,LiveData<PagedList<Notification>> 不会收到通知。我可以做些什么来触发LiveData 刷新(ViewModel 知道何时发生更改)。
【问题讨论】:
标签: android-architecture-components android-jetpack android-livedata android-paging android-architecture-lifecycle