【发布时间】:2016-09-18 08:25:44
【问题描述】:
我正在尝试让所有 Telegram 联系人在我的应用程序中使用,这是我的代码:
Cursor c = getContentResolver().query(
ContactsContract.RawContacts.CONTENT_URI,
new String[] { ContactsContract.RawContacts.CONTACT_ID, ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY },
ContactsContract.RawContacts.ACCOUNT_TYPE + "= ?",
new String[] { "org.telegram.messenger.account" },
null);
ArrayList<String> myTelegramappContacts = new ArrayList<String>();
int contactNameColumn = c.getColumnIndex(ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY);
while (c.moveToNext())
{
// You can also read RawContacts.CONTACT_ID to read the
// ContactsContract.Contacts table or any of the other related ones.
myTelegramappContacts.add(c.getString(contactNameColumn));
}
但它没有给我任何联系!
我的问题是什么?
org.telegram.messenger.account 帐户类型是否为真?或者我在哪里可以找到电报的帐户类型?
感谢您的关注。
【问题讨论】:
标签: android android-contacts telegram android-contact-mimetype