多少个数据库列与android的短信联系? [英] How many database columns associated with a SMS in android?

查看:126
本文介绍了多少个数据库列与android的短信联系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读的所有信息,然后从我的手机各自的详细信息。 为此,我现在用的是开放的我们是这样的:

I want to read all the messages and their respective details from my phone. For this I am using the Uri like this:

Uri sms = Uri.parse("content://sms/");

但我不知道有多少列的数据库,与此URI关联。

But I don't know how many columns in database which are associated with this uri.

我想显示以下信息:

  1. 消息类型
  2. 汇款人号
  3. 在邮件正文
  4. 时间戳

请任何人可以列举总列名?

Please can anybody enumerate the total column names?

推荐答案

您应该能够通过旋转光标并查找自己:

You should be able to rotate through the Cursor and look for yourself:

mCursor = managedQuery(sms, null, null, null, null);

StringBuffer info = new StringBuffer();
for( int i = 0; i < mCursor.getColumnCount(); i++) {
    info.append("Column: " + mCursor.getColumnName(i) + "\n");
}
Toast.makeText(getApplicationContext(), info.toString(), Toast.LENGTH_LONG).show();

这篇关于多少个数据库列与android的短信联系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆