0

I want to delete a MMS message of a particular phone number in android. How can i do it? I am using content://mms-sms/conversations to get list of MMS messaged and tried with the following query:

this.getContentResolver().delete(
                Uri.parse("content://mms-sms/conversations/" + ThreadId),
                "address=?", new String[] { "contact number" });`

But it works only for sms and not for mms. Can someone tell me what can we do to delete particular MMS?

Thanks

pablisco
  • 14,027
  • 4
  • 48
  • 70
Aamirkhan
  • 5,746
  • 10
  • 47
  • 74

1 Answers1

3

Please check below detailed Tutorial link for Read,Write,Delete and update MMS in Android

MMS in Android. Part 2. Working with MMS storage

Also Try this

Uri msgUri = ContentUris.withAppendedId(Mms.Inbox.Content_Uri,"1");

SqliteWrapper.delete(this, getContentResolver(), msgUri, null, null); (or) getContentResolver().delete(msguri, null, null);

Reference

Edit:

here is the method syntax

public static Uri withAppendedId (Uri contentUri, long id)

and Uri is the MMS inbox storage url in content provider

for example SMS Inbox Uri is "content://sms/inbox"

also read this page for MMS storage Uri info given here

Save/Create MMS in inbox Android

Community
  • 1
  • 1
swiftBoy
  • 35,607
  • 26
  • 136
  • 135
  • what is Mms in Mms.Inbox.Content_Uri? i am not able to find this class,can you clarify what is it? – Aamirkhan Jan 15 '13 at 10:35
  • What's the Uri value? check [this](http://stackoverflow.com/questions/6097319/save-create-mms-in-inbox-android) page for MMS inbox URI – swiftBoy Jan 15 '13 at 11:27
  • no this is not correct, did you check the page link I mentioned, just read that it has info what you need, to send mms. – swiftBoy Jan 15 '13 at 11:31