-2

I'm using SmsMessage to send sms via my application . this is my code :

 SmsManager sms = SmsManager.getDefault();
                            sms.sendTextMessage(tel, null, text, null, null);

it works fine and I've no problem with sending messages. the only issue is that I want to save sent sms in android message inbox.

How can I do so ?

navid abutorab
  • 189
  • 1
  • 2
  • 9
  • Possible duplicate of [How to save SMS to inbox in android?](http://stackoverflow.com/questions/642076/how-to-save-sms-to-inbox-in-android) – Mike M. Oct 09 '16 at 06:37

1 Answers1

2

Sms content provider can help you to write data into message inbox:

    ContentValues values = new ContentValues();
    values.put("address", tel);
    values.put("body", text);
    values.put("date", "135123000000");
    getContentResolver().insert(Uri.parse("content://sms/sent"), values);

Permission required:

 <uses-permission android:name="android.permission.WRITE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
SpiralDev
  • 7,011
  • 5
  • 28
  • 42