This is a picture of the intelligence podcast teacher talking about Android development.
One
Personprovider inherits the ContentProvider and implements the data manipulation classes in ContentProvider.
Adds a data change notification to an action that requires listening.
This.getcontext (). Getcontentresolver (). Notifychange (URI, NULL);
The second parameter, the data change listener, can not be set, also is set to NULL, if given this listener, no matter how many applications outside to set the listener, to listen to the data changes, this getcontentresolver () listener object, will inevitably get the data change notification.
This sentence is copied from elsewhere, but do not understand Ah Ah ~ ~ ~ ~
Second, set up monitoring
Setting up Monitoring
This.getcontentresolver (). Registercontentobserver (URI, True, new Personcontentobserver (New Handler ()));
For the parameters of this method, please refer to the following link in the explanation given by the great God:
Http://www.cnblogs.com/slider/archive/2012/02/14/2351702.html when an Insert method that calls Personprovider is applied, the onchange () method is executed, and print out the value of the field name.
when executed, the listener's app must be open.
Android,contentprovider+contentobserver+contentresolver, usage.