Show outbound texts using SMSManager in the default android text application

与世无争的帅哥 提交于 2019-12-24 01:55:21

问题


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



来源:https://stackoverflow.com/questions/13706526/show-outbound-texts-using-smsmanager-in-the-default-android-text-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!