Question

I am developing an android app trying to clear the call logs as in below code.

Uri uri = Uri.parse("content://call_log/calls");
getContentResolver().delete(uri, null, null);

This is working on all phones but not on Galaxy nexus with Android 4.3. I am not sure where I am going wrong. Please suggest how to clear call logs in version 4.3 and above.Thanks!

Was it helpful?

Solution

Add the following this will delete all your call logs from the phone:

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

then:

 <uses-permission android:name="android.permission.WRITE_CALL_LOG" /> 

to your manifest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top