我有两行代码:
private static final Uri SMS_INBOX = Uri.parse("content://sms/inbox");
Cursor c = getContentResolver().query(SMS_INBOX, null, null, null, null);
在哪里可以找到这个游标的列列表?
最佳答案
是的:)
private static final Uri SMS_INBOX = Uri.parse("content://sms/inbox");
Cursor c = getContentResolver().query(SMS_INBOX, null, null, null, null);
android.util.Log.i("COLUMNS", Arrays.toString(c.getColumnNames()));
答案是:
05-27 09:27:39: INFO/COLUMNS: [_id, thread_id, address, person, date, protocol,
read, status, type, reply_path_present, subject, body, service_center, locked]
顺便说一句,这是 MMSSMS 数据库中表 SMS 的确切表结构 - 将 DDMS 连接到模拟器并使用 FileExplorer 从以下位置获取整个数据库:
data/data/com.android.provider.telephony/databases/mmssms.db
然后使用 SQLite 数据库浏览器(免费)查看表格。一定要模拟来自 DDMS 的一条短信,这样表格中就会有一些东西,不过 :)
关于java - SMS Cursor 的列名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6150050/