-2

I have been trying to remove all the logs on the device through this code:

 contentResolver.delete(CallLog.Calls.CONTENT_URI,null,null);

But it only deletes Call Logs, and SMS logs still remain undeleted. How delete all the logs including SMS logs? Any help would be appreciated..!!

ashu
  • 1,756
  • 4
  • 22
  • 41
  • possible duplicate of [Deleting Android SMS programatically](http://stackoverflow.com/questions/8614211/deleting-android-sms-programatically) – Ahmed Ekri Sep 16 '13 at 12:24
  • May Helpful For u http://stackoverflow.com/questions/8614211/deleting-android-sms-programatically – Naveen Tamrakar Sep 16 '13 at 12:26
  • If I was using your program and I would have realized that you are tampering with my SMS log (I can imagine no application which should read my SMS') I would grab a rotary hoe and tousle your dog with it. Are you sure you want to have a mob of angry users ready to lynch you? No offense this was just theorycrafting. – Adam Arold Sep 16 '13 at 12:26
  • 1
    http://stackoverflow.com/questions/15246478/cant-remove-sms-logs-from-call-log-on-samsung-devices this is what i am asking! – ashu Sep 16 '13 at 12:56
  • @ashu check it out my answer work like charm. – Harshid Sep 18 '13 at 05:16

2 Answers2

0
getContext().getContentResolver().delete(
    Uri.parse("content://sms/conversations/" + threadID), 
    null, 
    null);

try this

Ahmed Ekri
  • 4,601
  • 3
  • 23
  • 42
0

You can remove all smslog using this way.

getContentResolver().delete(Uri.parse("content://sms/"),null,null);

for Deleting SMS from your smslog need uses permission declared in your manifest

 <uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS"/>
Harshid
  • 5,701
  • 4
  • 37
  • 50
  • I have already received a write solution to this by offering some bounty here > http://stackoverflow.com/questions/15246478/cant-remove-sms-logs-from-call-log-on-samsung-devices – ashu Sep 18 '13 at 07:07
  • please then post your answer.for New Stack overflow user. – Harshid Sep 18 '13 at 07:35