How to get sent sms list?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 02:53:56

问题


I am developing one application, based on that application i reseved messages.

My Code is as follows,

public class SmsReceiver extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent) 
    {
        //---get the SMS message passed in---
        Bundle bundle = intent.getExtras();        
        SmsMessage[] msgs = null;



        String str="";
        if (bundle != null)
        {
            //---retrieve the SMS message received---



            Object[] pdus = (Object[]) bundle.get("pdus");
            msgs = new SmsMessage[pdus.length];            
            for (int i=0; i<msgs.length; i++)
            {
                msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                
                str += "SMS from " + msgs[i].getOriginatingAddress();                     
                str += " :";
                str += msgs[i].getMessageBody().toString();
                str += "\n";   


            }

receiving messages it works fine.

but i want to get information about sent messages .

Please help me regarding this.


回答1:


there is no way to get broadcast intent of sent message, what you can do is.

1) You can put one contentObserver on sent message uri ,

2) See if new message added in this uri(by saving previous id and new id)

3) in this way you can achieve it.

see below link it did the same what i am talking about. Sent message observer



来源:https://stackoverflow.com/questions/8906135/how-to-get-sent-sms-list

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