0

I use the below code which works in different mobiles but only in moto e 4.4.4 version its not working. Please help me how can I solve this.

getContentResolver().delete(Uri.parse("content://sms"), "address=?", new String[] {address}) );
comrade
  • 4,590
  • 5
  • 33
  • 48
swetha
  • 23
  • 6
  • 2
    Possible duplicate of [Marking SMS messages as read/unread or deleting messages not working in KitKat](http://stackoverflow.com/questions/20158998/marking-sms-messages-as-read-unread-or-deleting-messages-not-working-in-kitkat) – Mike M. Jun 02 '16 at 07:37

1 Answers1

1

in 4.4 and upper version of android you should make your app as default sms app to be able to write in sms database. to do so you can use link bellow to find out how you can make your app default you can see : http://android-developers.blogspot.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html

in this link you will understand how you can bring a message to your user to mark your app as default sms app.

pouyan
  • 3,445
  • 4
  • 26
  • 44