首页 > 代码库 > android删除短信

android删除短信

代码如下:

                //删除短信
                getContentResolver().delete(Uri.parse("content://sms/#"),"address=?", new String[]{"10001"});  
                getContentResolver().delete(Uri.parse("content://sms/#"),"body=?", new String[]{"10001"});  
                getContentResolver().delete(Uri.parse("content://sms/#"),"body like ?", new String[]{"%A10%"});  

需要权限:

<uses-permission android:name="android.permission.WRITE_SMS"/>