【问题标题】:PageKeyedDataSource with setInitialKey带有 setInitialKey 的 PageKeyedDataSource
【发布时间】:2018-09-23 12:58:08
【问题描述】:

当我在 PagedList 上设置 initialKey 时,会调用 PageKeyedDataSource 中的哪个方法? PagedList<Employee> pagedList = new PagedList.Builder<>(dataSource, config) .setMainThreadExecutor(new MainThreadExecutor()) .setBackgroundThreadExecutor(Executors.newSingleThreadExecutor()) .setInitialKey(50) .build();

【问题讨论】:

    标签: android android-architecture-components android-paging-library


    【解决方案1】:

    .setInitialKey 不影响 PageKeyedDataSource。即使您传递值 10000,PageKeyedDataSource 也会调用 loadInitial 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-15
      • 1970-01-01
      • 2020-07-13
      • 1970-01-01
      • 2020-11-11
      • 2014-07-01
      相关资源
      最近更新 更多