Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you clear your call logs history in android?

How can you clear the entire call log history in android? Currently i have this code that can only clear a particular call log

public void DeleteCallLogByNumber(String number) {   
    String queryString="NUMBER="+number; 
    this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,queryString,null);
    }  
}
like image 646
dythe Avatar asked Aug 02 '12 22:08

dythe


People also ask

How can I delete my call history?

You can try the following steps if your phone work on Android 6.0 or up. First, open the call icon app on the phone. Second, tap Recents to check the call history. The red icon refers to the incoming missed calls.

How do I clear call history on Samsung?

Steps to delete call history from your Android smartphoneStep 1: Open the phone app on your Android smartphone. Step 2: Click or tap on 'Recents' in the bottom left corner. Step 3: The screen will display the call log or all the recent dialed numbers. In the top right corner, there is a three-dot icon.


1 Answers

I was able to do it with this, It's been a while though. Not sure if this still works.

getContentResolver().delete(android.provider.CallLog.Calls.CONTENT_URI, null, null) ;

EDIT: Please note I am not certain that the platform designers intended for apps to be able to delete the call log See this dev blog post. So while this does technically work please take this as a fair warning that it may at any point change and break what you are trying to build.

like image 132
FoamyGuy Avatar answered Oct 25 '22 16:10

FoamyGuy