I am developing an application in which i want to delete the entry in the call log which is the last outgoing call number. I need to do this when i am finished the outgoing call. The issue I am facing is I cannot retrieve the last dialled number from CallLog when the call is finished. I have used the PhoneStateListener and tried to capture the IDLE state. Still no luck.
Asked
Active
Viewed 1,276 times
0
-
http://stackoverflow.com/questions/14019684/delete-call-log-in-android-for-particular-number – AnilPatel Jun 21 '13 at 12:18
-
Did you resolve this issue? I need to hide call logs from perticular contact, can you help me regarding this ? – Hardik Joshi Nov 19 '14 at 18:25
1 Answers
0
make sure u have following permission in manifast.xml:
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
for Deleting Calllogs for particular number try this way:
public void DeleteCallLogByNumber(String number) {
String queryString="NUMBER="+number;
this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,queryString,null);
}
}

Sagar Maiyad
- 12,655
- 9
- 63
- 99

KOTIOS
- 11,177
- 3
- 39
- 66
-
I have tried this. But the problem is I cannot get the number to be deleted when the call is finished. It take some time to populate the number in call log. – Chanaka udaya Jun 21 '13 at 12:46