我开发了一个应用程序来处理收件箱中的短信并进行处理。处理后从收件箱中删除该短信。但删除短信时出错。
我试过这段代码:
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
String phoneNo, msg;
while (cur.moveToNext()) {
phoneNo = cur.getString(2);
msg = cur.getString(11);
// do some process
String pid = cur.getString(1);
String uri = "content://sms/conversations/" + pid;
getContentResolver().delete(Uri.parse(uri), null, null);
}