Hi,

I want to react to a change in the phone book by transmitting the
whole contact list to a webservice. For this I use a ContentObserver:

ContentResolver cr = getContentResolver();
 ContactPplContentObserver      pplObserver = new
ContactPplContentObserver( handler );
 cr.registerContentObserver(People.CONTENT_URI, true,
                                                        pplObserver );

where ContactPplContentObserver extends the ContentObserver class:

class ContactPplContentObserver extends ContentObserver {
        public ContactPplContentObserver(Handler h) {
                super(h);
        }

        public void onChange(boolean selfChange) {

                c.requery();     //c is a cursor on the Contacts.People
                String xml = getXMLMessage(c);
                uploadAllContacts(xml);
        }
    }


The problem is that whenever I add/edit a new contact, only the 'name'
field of the contact list gets transmitted to the ContentObserver, but
the 'number' field stays the same (hence null if a new contact is
added). It seems that it is failing to record the added/edited number.
Why might this be? Do I need to register the cursor  instead of the
People Uri?

thanks,
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to