0

SMS 内容提供程序中的时间戳和日期列有什么区别?谁能告诉我如何根据指定日期获取消息列表?

4

1 回答 1

0

这里有关于列的详细信息:(但是,它确实取决于 URI,您将用于查询) http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android /2.3.7_r1/android/provider/Telephony.java#Telephony.TextBasedSmsColumns

The date the message was sent
Type: INTEGER (long)
public static final String DATE = "date";

获取给定日期消息的代码(您需要 READ_SMS 权限):

final Cursor myMessages = context.getContentResolver().query(Uri.parse("content://sms"), new String[] { "address", "_id", "body", "type", "date", "read", "thread_id" }, "date > your_timestamp", null, "date ASC");
于 2012-04-13T09:19:55.357 回答