/** * 插入 草稿箱 * * @param context * @param msg */ public static void insertMessageIntoDraft(Context context, Message_ msg) { String phone = msg.getMessage_phone(); phone = phone.replace("+86", ""); if (Utils.isMobilePhone(phone)) { phone = "+86" + phone; } ContentValues values = new ContentValues(); values.put("address", msg.getMessage_phone()); values.put("body", msg.getMessage_content()); values.put("date", msg.getMessage_time()); values.put("read", 0); values.put("type", 1); // values.put("service_center", "+8613010776500"); context.getContentResolver().insert(Uri.parse("content://sms/draft"), values); }
/** * 插入 已发送短信箱 * * @param context * @param msg */ public static void insertMessageIntoOutbox(Context context, Message_ msg) { String phone = msg.getMessage_phone(); phone = phone.replace("+86", ""); if (Utils.isMobilePhone(phone)) { phone = "+86" + phone; } ContentValues values = new ContentValues(); values.put("address", msg.getMessage_phone()); // values.put("person", msg.get); // values.put("protocol", "0"); values.put("date", msg.getMessage_time()); values.put("read", "1"); values.put("status", "-1"); values.put("body", msg.getMessage_content()); Uri u = context.getContentResolver().insert(Uri.parse("content://sms/outbox"), values); }