[android-developers] content observer for calllog works on 1.6 but fails on 2.0

2010-03-03 Thread tjlian616
Dear all,

I am working on a app that can monitor the change in call log and
delete specific call history if it exists. The goal is to be able to
never show call history with some contacts.

It uses a ContentObserver to observe the change in CallLog.Calls. When
onChange() gets called, it will do a contentResolver.delete(...) to
remove history with some contacts. The code is below.

The problem I have now is that it works fine on 1.5, 1.6 but fails on
2.0,2.1.

On 2.0, after making a call, the phone will turn to calllog view
automaticlly, and then my observer is called forever I mean it's
continuously getting called, thousands of times, until I manually
uninstall it...

Could anyone help me with this? Why it happens and how should I fix
it?

Thank you!!

Code for adding observer:

ContentResolver cr = getContentResolver();
CallObserver co = new CallObserver( mHandler );
cr.registerContentObserver( CallLog.Calls.CONTENT_URI, true, co 
);

Here is the code for CallObserver

private class CallObserver extends ContentObserver{
public CallObserver(Handler h){
super(h);
}
@Override
public void  onChange(boolean b){
Log.w(Carrot, called onChange);
some_delete_calllog_function();
}
}

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


[android-developers] Content Observer

2010-02-18 Thread Kiran
As per normal content observer, you will just get to know that content
has been changed but not the data.

So how can I exactly find out what changes has been made using Content
Observer?
Is there any alternative way to obtain the changes done on specific
content URI?

Thanks a lot in advance !!

Thanks
kiran

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