android application delete only one sms in the inbox -
hi friends create delete sms delete sms want delete 1 sms. can possible if possible how can it. if code available please send me. please me.
thanks in advance.
simply use code.
try { uri urisms = uri.parse("content://sms/inbox"); cursor c = context.getcontentresolver().query( urisms, new string[] { "_id", "thread_id", "address", "person", "date", "body" }, "read=0", null, null); if (c != null && c.movetofirst()) { { long id = c.getlong(0); long threadid = c.getlong(1); string address = c.getstring(2); string body = c.getstring(5); string date = c.getstring(3); if (message.equals(body) && address.equals(number)) { // mlogger.loginfo("deleting sms id: " + threadid); context.getcontentresolver().delete( uri.parse("content://sms/" + id), "date=?", new string[] { <your date>}); log.e("log>>>", "delete success........."); } } while (c.movetonext()); } } catch (exception e) { log.e("log>>>", e.tostring()); }
Comments
Post a Comment