Search code examples
androidsmssmsmanager

Show outbound texts using SMSManager in the default android text application


I'm currently writing an application that uses the users voice to send out text messages, I am using the SMSManager to send texts and it works. The issue I am having is when I go to the text messaging application to view my text history I don't see my sent texts. Is there a way for my sent texts from the SMSManager to appear in my text history?

Thanks!


Solution

  • After sending use this code

    Context context; //you should initialize it somewhere
    ...
    ContentValues values = new ContentValues();
    values.put("address", number);
    values.put("body", message );
    values.put("date", time );
    context.getContentResolver().insert(Uri.parse("content://sms/sent"), values);
    

    But this is unofficial