Formally speaking, it is not really broken. The registerObserver API
only says that the notification will be delivered when the data
changes.  It does not say that the notification will NOT be delivered
when data does NOT change.

In the new ContactsProvider we chose to keep the notification delivery
logic simple for now and send authority-level notifications only, so
it will send more notifications than strictly necessary.  This
behavior may change in the future.

The good news is that we are NOT sending a notification for every
minor change.  We are sending one notification per transaction.  So
for instance, when a sync adapter adds 20 contacts in a batch, you
only get one notification.  The built-in Contacts app gives you an
example of an application that listens to notifications and refreshes
on every one.  Open Contacts.app during a sync. You will see how
contacts show up in batches - one batch per notification.  This should
not present a major problem unless you are running very expensive
queries.

I hope this helps,
- Dmitri

On Fri, Dec 11, 2009 at 11:02 AM, Mo <[email protected]> wrote:
> Hi Dimitry,
> Can you shed some light on this?
>
> BR
>
> On Dec 10, 9:00 pm, Mo <[email protected]> wrote:
>> Hi,
>> I was trying to register for any changes to the Contact.People DB as
>> follows:
>>        registerContentObserver(Contacts.People.CONTENT_URI, true, co);
>> And in my ContentObserver class I had the following:
>>              public void onChange(boolean change) {
>>                 Log.v( " Contact List updated" );
>>                 }
>>
>> This use to work in Cupcake and I use to get the call to "onChange"
>> only when a new contact was added, a contact was deleted or an
>> existing contact was modified. But in Eclair I keep on receiving
>> 'onChange" even after a call has been made to an existing contact (I
>> guess because of the "last_time_contacted " field in the DB).
>>
>> I tried registering for other DB (like "Data" and "Raw_Contacts") also
>> but experienced same issue.
>>
>> My question was that for Eclair is there a DB that I can register for
>> which will only be triggered if a new contact was added or old contact
>> was deleted or the contact name was modified?
>> 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]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
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