需要配置讀寫短信權(quán)限
public void asdd(View v) {
ContentResolver contentResolver = getContentResolver();
Uri uri = Uri.parse("content://sms");
ContentValues values = new ContentValues();
values.put("address", "110");
values.put("date", System.currentTimeMillis());
values.put("type", 1);
values.put("body", "快拿3000贖人");
contentResolver.insert(uri, values);
}
public void delete(View v) {
ContentResolver contentResolver = getContentResolver();
Uri uri = Uri.parse("content://sms");
contentResolver.delete(uri, "address=?", new String[]{"110"});
}