Skip to content

If updating adapter item list later on through notifyDataSetChanged, invalid state #49

Description

@dvdciri

Context

When passing an empty list to the adapter and updating the last later on, through notifyDataSetChanged, the adapter will end up saving not all the list of items, but only the one that are bind to a view (because of the internal logic of the MultiChoiceAdapter). This is putting the app in an invalid state because when we go to selectAll items, for instance, the MultiChoiceAdapter knows only about those binded items and not the non-binded ones.

Possible solution

It might be necessary to ask the user in the MultiChoiceAdapter constructor or somewhere else, maybe forcing it through an abstract method, to provide the item size list.

Or it might just work that when we found an item not in the list of items, we re-call getItemCount() method of the Adapter and re-init the list the new INACTIVE items.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions