Failed sending messages storage android

混江龙づ霸主 提交于 2019-12-11 03:18:46

问题


Just want to ask where does the default android messaging app stores and read failed to send messages. I thought it can be queried on content://sms/sent with STATUS_FAILED as status. Thanks.


回答1:


Telephony.Sms.Outbox. This class will help you retreive messages which were not sent due to some reason.

use URI as content://sms/failed for retrieving failed sent messages.

Similarly other types can be retrieved as :

Inbox = "content://sms/inbox"
Failed = "content://sms/failed"
Queued = "content://sms/queued"
Sent = "content://sms/sent"
Draft = "content://sms/draft"
Outbox = "content://sms/outbox"
Undelivered = "content://sms/undelivered"
All = "content://sms/all"
Conversations = "content://sms/conversations".

If you want to retrieve it based on type, take a look here.

        public static final int MESSAGE_TYPE_ALL    = 0;
        public static final int MESSAGE_TYPE_INBOX  = 1;
        public static final int MESSAGE_TYPE_SENT   = 2;
        public static final int MESSAGE_TYPE_DRAFT  = 3;
        public static final int MESSAGE_TYPE_OUTBOX = 4;
        public static final int MESSAGE_TYPE_FAILED = 5; // for failed outgoing messages
        public static final int MESSAGE_TYPE_QUEUED = 6; // for messages to send later


来源:https://stackoverflow.com/questions/25627673/failed-sending-messages-storage-android

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