GROUPS: { private Cursor getGroups() // Run query Uri uri = ContactsContract.Groups. String[] projection = ContactsContract.Groups. ContactsContract.Groups. CONTENT_URI ; new String[] { _ID , TITLE }; String selection = ContactsContract.Contacts. ( String sortOrder = ContactsContract.Groups. IN_VISIBLE_GROUP + " = '" + mShowInvisible ? "0" : "1" ) + "'" ; TITLE + " COLLATE LOCALIZED ASC" ; //return managedQuery( uri , projection, selection, selectionArgs, sortOrder); } Cursor groupCursor = getGroups(); groupCursor.moveToFirst(); { Log. e ( i++; groupCursor.moveToNext(); } return managedQuery(uri, projection, null , null , sortOrder); while ( i < groupCursor.getCount() ) groupNames [i] = groupCursor.getString(groupCursor.getColumnIndex(ContactsContract.Groups. TITLE )); "GROUP " , " " + groupNames [i]);