0

I am using this link to try delete recent sms. This code works fine and it shows sms deleted successfully in logcat but still not deleted from phone.

I am using this code when I am getting otp from broadcastreciever after that I want to delete my otp sms.

Help me I donot know to achieve that.

BlackBlind
  • 772
  • 9
  • 26
  • As per your reference link, have you tried placing delay while **deleting SMS**. – Jeel Vankhede May 01 '19 at 13:46
  • Since KitKat (4.4), you cannot delete SMS messages unless your app is the default messaging app. Is your app the default? I wouldn't think so, because then it would be responsible for saving the incoming SMS messages, which you could just not do for your OTP messages. – Mike M. May 01 '19 at 13:49
  • @MikeM. no bro I am just want to delete from any app – BlackBlind May 01 '19 at 13:52
  • Well, as I mentioned, you can't. Only the default SMS app has write access to the SMS Provider. It's been like that for many years, now. – Mike M. May 01 '19 at 13:54
  • @MikeM. can you help me on my one more question. if you want I will share link with you. – BlackBlind May 02 '19 at 07:01
  • I can take a look. No guarantees, though. – Mike M. May 03 '19 at 01:16

0 Answers0