Failed sending messages storage android

2019-07-21 16:56发布

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条回答
一纸荒年 Trace。
2楼-- · 2019-07-21 17:41

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
查看更多
登录 后发表回答