2012-04-24 37 views
4

我知道短信提供商不应该被使用,但我想知道什么是“状态”字段的可能值(其他一些字段也是,但我是大多在状态兴趣),我做什么时,这些值的含义:Android的短信状态

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 

回答

8

我已经自己找到了答案。在class/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; 

如果你有兴趣在这些值,你可能想看看列“类型”了。它可能是有用的。

+0

链接已损坏。 – powder366 2017-01-12 16:25:27

+1

@ powder366 https://android.googlesource.com/platform/frameworks/opt/telephony/+/master/src/java/android/provider/Telephony.java应该可以工作 – p4u144 2017-01-13 12:38:01

+0

如何获取未发送的已发送消息意味着状态是** STATUS_FAILED ** – 2018-01-22 07:41:01