Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove call logs from android programmatically?

how to delete/remove call log from application. I am doing like this

 this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,null,null);

it not working.

like image 476
sai Avatar asked Jun 08 '12 10:06

sai


1 Answers

Accepted answer will delete all calls from call log for a specific number. If you want to delete a only single call you can do it by passing CallLogId to that function and run this query.

public void DeleteCallById(String idd) {   
    this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,CallLog.Calls._ID + " = ? ",
            new String[] { String.valueOf(idd) });
    }  
like image 81
user2409402 Avatar answered Sep 18 '22 11:09

user2409402