What does the method adapter.notifyDataSetInvalidated() accomplish?
There is no documentation on it.
I am trying to reload a ListView and notifyDataSetChanged or notifyDataSetInvalidated don’t seem to accomplish anything.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on the adapter implementation… if you take a look of the source code you will see that:
notifyDataSetInvalidated()calls thenotifyInvalidated()of theDataSetObservableclass (see here)notifyInvalidated()calls theonInvalidated()method for eachDataSetObserver(see here).onInvalidated()does not do anything…This is its implementation:
DataSetObserveris an abstract class, so it’s up to the subclass to decide what to do ononInvalidated().