Android短信状态

时间:2012-04-24 08:47:33

标签: android sms status

我知道不应该使用SMS提供程序,但是我想知道名为“status”的字段的可能值是什么(其他一些字段也是如此,但我最感兴趣的是状态)以及这些值在我这样做时的含义:

Uri uriSms = Uri.parse("content://sms/inbox");
Cursor c = context.getContentResolver().query(uriSms, null,null,null,null); 

//fields retrieved
0: _id
1: thread_id
2: address
3: person
4: date
5: protocol
6: read   
7: status
8: type
9: reply_path_present
10: subject
11: body
12: service_center
13: locked

1 个答案:

答案 0 :(得分:9)

我自己找到了答案。在类core / java / android / provider / Telephony.java(class on github here)中。有这些代码行:

/**
* The TP-Status value for the message, or -1 if no status has
* been received
*/
public static final String STATUS = "status";

public static final int STATUS_NONE = -1;
public static final int STATUS_COMPLETE = 0;
public static final int STATUS_PENDING = 32;
public static final int STATUS_FAILED = 64;

如果您对这些值感兴趣,可能还需要查看“类型”列。它可能很有用。