What is the difference between notifydatasetinvalidated () and notifydatasetchanged () in Android?

Source: Internet
Author: User

Look at the source code for these two methods

public void notifydatasetchanged ()

The method internally implements the invocation of the OnChanged event on top of each observer. This method is called whenever a change in the data set is found, or when a new state of the data is read.


public void notifydatasetinvalidated ()

The method internally implements the invocation of the Oninvalidated event on top of each observer. This method is called whenever a data set monitoring change is found.

It's plain to understand, literally, that

1: If the data source to be refreshed is changed, call notifydatasetchanged () For example: We are in Sina Weibo, to display the micro-blog to refresh;

2: If the data source fails, call notifydatasetinvalidated ()
Does it feel a lot easier to understand this? Oh

What is the difference between notifydatasetinvalidated () and notifydatasetchanged () in Android?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.