Getting really weird long Contact Group names

Posted by Pentium10 on Stack Overflow See other posts from Stack Overflow or by Pentium10
Published on 2010-05-04T19:51:08Z Indexed on 2010/05/07 1:58 UTC
Read the original article Hit count: 340

When looking at the Contact Groups on Google Contacts or in the People application of my HTC Legend phone, I get the groups names ok eg: Friends, Family, VIP, Favorite etc...

But in my application I get really wrong names such as
"Family" became "System Group: Family"
"Friends" became "System Group: Friends"
"Favorite" became "Favorite_5656100000000_3245664334564"

I use the below code to read these values:

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;
    }

What I am missing?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk