【发布时间】:2009-10-13 08:09:22
【问题描述】:
我已经申请了从 android 通讯录中读取所有联系人及其值的应用程序,但我无法读取所有联系人的值。 目前我只得到它的名字和手机号码。
我怎样才能得到它的所有电话号码、所有 eamil 值和地址值?
提前谢谢...
【问题讨论】:
-
我正在尝试从我的应用程序中读取联系人详细信息。我有光标对象。我怎样才能找到联系人的所有详细信息。我想同步我的联系人。
-
Uri 联系人 = Uri.parse("content://contacts/people");光标 cur = managedQuery(contacts, projection, null, null, null); if (cur.moveToFirst()) { 字符串名称;字符串电话号码; int nameColumn = cur.getColumnIndex(People.NAME); int phoneColumn = cur.getColumnIndex(People.NUMBER);做 { name = cur.getString(nameColumn); phoneNumber = cur.getString(phoneColumn); } 而 (cur.moveToNext()); }
-
究竟是什么不工作?此外,您没有提取电子邮件列,这可以解释为什么您没有得到该结果。
-
我怎样才能找到 eamil 和地址列。我没有得到任何返回 eamil 和地址列的东西,例如 phoneColumn = cur.getColumnIndex(People.NUMBER);用于电话列。