In your case, three tables have been updated after the contact is
saved: people, contact_methods and phones. So your observer got
notified three times.

On Mar 30, 8:12 pm, gganesh <ganesh....@gmail.com> wrote:
> I have a service running, under which i have declared  observer class
> for to notify any changes in contact list
> when my contact list is saved I found the onChange is executed 3
> times .I could not figure out the reason.
> Any suggestions? where i went wrong
>
> here is my code
>
> public class LocalService extends Service {
> MyObserver myob;
>
>        class MyObserver extends ContentObserver {
>           public MyObserver( Handler h ) {
>                 super( h );
>                }
>         public void onChange(boolean selfChange) {
>                 Log.d( getClass().getSimpleName(), "IN ONCHANGE  -- UpDates 
> have
> been noted " );
>
>           }
>    }
>
>  public void onCreate() {
>      registerContentObservers();
>
> }
>
>  private void registerContentObservers() {
>                 ContentResolver cr = getContentResolver();
>                  myob = new MyObserver(handler_object);
>                 cr.registerContentObserver
> ( Contacts.People.CONTENT_URI, true,myob );}
> }
>
> Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to