Get Groups from phone

GROUPS:
{
private Cursor getGroups()// Run queryUri 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]);

Comments

Popular posts from this blog

Working with Android Hierarchy Viewer

Android: Standalone login with SQLiteOpenHelper