Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Explain more clearly about ListAdapter #401

Open
@nvmnghia

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /