In this ListAdapter guide, the adapter has to be roughly modified like this:
public ContactsAdapter(List<Contact> contacts) {
super(DIFF_CALLBACK);
this.mContacts = contacts;
submitList(this.mContacts);
}
The guide didn't stress the importance of calling submitList() even in the first time mContacts is assigned.
I thought that submitList() would have to be trigger on subsequent modifications, because if it had been triggered, what would have it compare to? Turn out it does compare to null, and you have to submitList() that.
In this
ListAdapterguide, the adapter has to be roughly modified like this:The guide didn't stress the importance of calling
submitList()even in the first timemContactsis assigned.I thought that
submitList()would have to be trigger on subsequent modifications, because if it had been triggered, what would have it compare to? Turn out it does compare tonull, and you have tosubmitList()that.