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