问题
My Android App is using the following code to send an SMS Message:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(smsMessage.getNumber(), null, smsMessage.getText(), sentPI, deliveredPI);
However, is it possible to save the outgoing message so that it is displayed in the default SMS app, just as if the user used the default app to send it?
Thanks
回答1:
you must insert your smsMessage into default SMS_database
like this
public void insertSMS(String address,String body){
private ContentResolver resolver = null;
resolver = context.getContentResolver();//context is your instance of Activity
ContentValues values = new ContentValues();
values.put("address", address);
values.put("body", body);
resolver.insert(Uri.parse("content://sms/sent"), values);
}
来源:https://stackoverflow.com/questions/9746398/android-write-to-default-sms-app