Determine the ContentObserver

Posted by tommieb75 on Stack Overflow See other posts from Stack Overflow or by tommieb75
Published on 2010-12-13T02:44:47Z Indexed on 2010/12/24 1:54 UTC
Read the original article Hit count: 511

Filed under:
|

I have this content observer that is watching on the Call Log:

public class monitorCallLog extends ContentObserver{
    private static final String TAG = "monitorCallLog";
    public monitorCallLog(Handler handler) {
        super(handler);
        // TODO Auto-generated constructor stub
    }
    @Override
    public boolean deliverSelfNotifications() { 
        return false; 
    }
    @Override
    public void onChange(boolean selfChange){
        Log.v(TAG, "[onChange] *** ENTER ***");
        super.onChange(selfChange);
        // Code goes in here to handle the job of tracking....
        Log.v(TAG, "[onChange] *** LEAVE ***");
    }
}

Now... how can I determine the nature of the change on this URI content://call_log/calls?

I want to check on it if a deletion has occurred on the said URI... but there is no way of knowing...this seems to apply on a query/delete/insert/update on said URI that triggers the onChange method....

any tips/suggestions?

© Stack Overflow or respective owner

Related posts about android

Related posts about contentobserver