Android Contentobserver Detailed

Source: Internet
Author: User

Preface: Work, need to open a thread a large number of queries a database value sent a change, resulting in a lot of overhead, later in the boss's guidance, the use of contentobserver perfect solution to the problem, feel very excited, After the finish, I also made a summary of contentobserver.

contentobserver--content Observer, the purpose is to observe (capture) a particular URI caused by the changes in the database, and then do some corresponding processing, it is similar to the database technology triggers (Trigger), when the Contentobserver observed by the URI changes , it will be triggered. Triggers are divided into table triggers, row triggers, and accordingly contentobserver are also classified as "table Contentobserver,

The line contentobserver, of course, is related to the URI MIME type it listens on.

Summary: The use of contentobserver is mainly a case of both:

1, the need to frequently detect the database or whether a data change, if the use of threading to operate, very economical and time-consuming;

2, in the case of users do not know the database to do some events, such as: Quietly send information, refuse to accept text messages blacklist, etc.;

In both cases, the use of contentobserver is undoubtedly the best razor.

See more: http://www.cnblogs.com/slider/archive/2012/02/14/2351702.html

Android Contentobserver Detailed

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.