我有以下代码:
它不会保存到我的收件箱
try{
Bundle bundle = intent.getExtras();
String message = bundle.getString("message");
String pnumber = bundle.getString("number");
String time = bundle.getString("timestamp");
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(pnumber, null, message, null, null);
Toast.makeText(context,"Message Sent to " + pnumber,
Toast.LENGTH_SHORT).show();
ContentValues my_values = new ContentValues();
my_values.put("body", message);
my_values.put("address", pnumber);
context.getContentResolver().insert(Uri.parse("content://sms/sent"), my_values);
}
catch(Exception e){
Toast.makeText(context, "Error but Received!", Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
请帮助我如何保存此发送的短信