1

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

jtnire
  • 1,348
  • 5
  • 21
  • 32
  • Found the answer here: http://stackoverflow.com/questions/642076/how-to-save-sms-to-inbox-in-android – jtnire Mar 17 '12 at 01:36

1 Answers1

2

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);

}