Show outbound texts using SMSManager in the defaul

2019-07-09 04:31发布

问题:

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!

回答1:

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