1

I'm refactoring a RecyclerView.Adapter to ListAdapter. One unexpected thing after 3 staring hours is that submitList() has to be called when the list is first populated.

I always thought that submitList() was the unification of notify*(), which means it is called on subsequent list modifications. However, with ListAdapter, even the first time (this.someList = list; inside constructor) is counted as modification, and submitList(this.someList) has to be called right after that.

Is there any way to avoid calling submitList() inside the constructor?

Minh Nghĩa
  • 854
  • 1
  • 11
  • 28
  • Can [this](https://stackoverflow.com/a/50031492/8244632) help? – Lalit Fauzdar Jun 20 '20 at 18:07
  • @LalitFauzdar I don't think it is relevant to my question, and I'm not in the right mood to dig the source code. Your link's problem: rendered fine 1st time, edit data, no render. My problem: no render at all, add new data, render 1st time. Anyway, I know the questioner's frustration =))). – Minh Nghĩa Jun 21 '20 at 09:14

0 Answers0