1

在 Google 通讯录或我的 HTC Legend 手机的人脉应用程序中查看联系人组时,我得到了组名,例如:朋友、家人、VIP、收藏夹等...

但是在我的应用程序中,我得到了非常错误的名称,例如
“家庭”变成了“系统组:家庭
“朋友”变成了“系统组:朋友
“收藏夹”变成了“ Favorite_5656100000000_3245664334564

我使用下面的代码来读取这些值:

public Cursor getFromSystem() {

        // Get the base URI for the People table in the Contacts content
        // provider.
        Uri contacts = ContactsContract.Groups.CONTENT_URI;
        // Make the query.
        ContentResolver cr = ctx.getContentResolver();
        // Form an array specifying which columns to return.
        String[] projection = new String[] {
                ContactsContract.Groups._ID, ContactsContract.Groups.TITLE,
                ContactsContract.Groups.NOTES
        };

        Cursor managedCursor = cr.query(contacts, projection, ContactsContract.Groups.DELETED
                + "=0", null, ContactsContract.Groups.TITLE + " COLLATE LOCALIZED ASC");
        return managedCursor;
    }

我错过了什么?

4

1 回答 1

1

这听起来像一个错误。我的一部测试手机的标题正确/经过消毒,而另一部的标题类型不正确。我会在这里归档。

我还contacts2.db直接检查了数据库,发现该SYSTEM_ID列似乎已经过清理——但这可能不安全用于显示目的。

于 2010-05-07T01:54:21.100 回答