Sending SMS programatically not stored in outbox?

半世苍凉 提交于 2019-12-02 19:17:29

问题


I'm making a project SMS programatically .. I use this code to send sms:

SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI);    

If message sent and delivered, not stored in outbox. Cau u fix that? thanks!


回答1:


The concept of a "SENT" folder is a feature of an application, not the operating system. If you wish to create your own SMS client application, create your own "SENT" folder as a feature of that application. You know what messages you are sending, so you can store them wherever you like (e.g., SQLite database).

If you want to send SMS messages and have them appear in the "SENT" folder of the user's chosen SMS client, don't use SmsManager. Instead, use ACTION_SENDTO and have the message be sent by the user's chosen SMS client, as is demonstrated by this sample project.

Original Source Here.



来源:https://stackoverflow.com/questions/12741408/sending-sms-programatically-not-stored-in-outbox

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