2014-09-02 245 views
1

只想問一下默認的android消息傳遞應用存儲和讀取失敗的地方發送消息。我認爲可以在content://sms/sent上以STATUS_FAILED作爲狀態查詢。謝謝。發送消息失敗失敗android

回答

3

Telephony.Sms.Outbox。該課程將幫助您檢索由於某種原因未發送的郵件。

使用URI作爲content://sms/failed來檢索失敗的已發送消息。

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". 

如果您想根據type找回它,看看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 
+0

希望能幫助你實現你想要的東西:) – 2014-09-02 16:28:29

+0

謝謝先生。 :)發現我不需要對失敗的消息進行其他查詢,我正在查詢某個thread_id的所有消息,並且包含失敗的消息。只需要檢查它的類型。 – 2014-09-02 16:29:04

+0

如何獲取處於掛起狀態的已發送消息? – 2018-01-22 07:38:44