Thanks Mark

But is there any way to know what fields are changed.


On Feb 3, 10:08 pm, Mark Roberts <[email protected]> wrote:
> You can register an observer to monitor a specific uri.  For example:
>
> Define the observer
> private ContentObserver yourObserver = new ContentObserver(new Handler
> ()) {
>         @Override
>         public boolean deliverSelfNotifications() {
>             return true;
>         }
>
>         @Override
>         public void onChange(boolean selfChange) {
>             Cursor cursor = getCursor();
>             if (cursor != null && !cursor.isClosed()) {
>                 cursor.requery();
>             }
>         }
>     };
>
> Now add the code to register it.
> getContentResolver().registerContentObserver(Uri.parse("content://
> contacts/people"),
>                     true, yourObserver);
>
> This will notify you whenever a change is made to the people table.
> It will not however tell you what was changed.
>
> On Feb 3, 11:40 am, Shrikant Agrawal <[email protected]> wrote:
>
> > Hi
>
> > Is there any way to know the changes made in the address book.
> > What I want to know is that whenever an contact is added ,modified or
> > deleted  my app should receive the notification as well as the ID of
> > the contact changed.
>
> > Thanks in advance
> > Shrikant
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to