在文本视图中显示所有者的电子邮件地址和姓名

Displaying owner's email address and name in textview

这是我的客户经理代码。我想在文本视图中显示所有者的姓名和电子邮件地址

final AccountManager manager = AccountManager.get(this);
final Account[] accounts = manager.getAccountsByType("com.google");
if (accounts[0].name != null) {
    accountName = accounts[0].name;
    String where = ContactsContract.CommonDataKinds.Email.DATA + " = ?";
    ArrayList<String> what = new ArrayList<String>();
    what.add(accountName);
    txt2.setText(accountName);
    Log.v("Got account", "Account " + accountName);
}

它正在显示 owner/user 的电子邮件地址。如何获取 user/owner 的 profile/full/first 名称? 这个网上已经问了很多这样的问题。但对我来说没有任何效果。

他的 where 语句是什么?

String where = ContactsContract.CommonDataKinds.Email.DATA + " = ?";

看看简介 API :

http://developer.android.com/reference/android/provider/ContactsContract.Profile.html

这仅在用户配置了配置文件时有效。

如果您需要来自服务器的配置文件,您可以使用目录搜索 - Google 并且 Exchange 帐户支持此功能。 您可以使用您已经设法获取的电子邮件地址查询目录并检索完整数据。