Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/provider/ContactsContract.Groups#constants) \| [Inherited Constants](https://developer.android.com/reference/android/provider/ContactsContract.Groups#inhconstants) \| [Fields](https://developer.android.com/reference/android/provider/ContactsContract.Groups#lfields) \| [Methods](https://developer.android.com/reference/android/provider/ContactsContract.Groups#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/provider/ContactsContract.Groups#inhmethods)

# ContactsContract.Groups

*** ** * ** ***

` public static final class ContactsContract.Groups `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/provider/BaseColumns, https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns, https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.ContactsContract.Groups |

<br />

*** ** * ** ***

Constants for the groups table. Only per-account groups are supported.

## Columns

| Groups ||||
|---|---|---|---|
| long | `https://developer.android.com/reference/android/provider/BaseColumns#_ID` | read-only | Row ID. Sync adapter should try to preserve row IDs during updates. In other words, it would be a really bad idea to delete and reinsert a group. A sync adapter should always do an update instead. |
| String | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#DATA_SET` | read/write-once | The data set within the account that this group belongs to. This allows multiple sync adapters for the same account type to distinguish between each others' group data. The combination of `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE`, `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME`, and `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#DATA_SET` identifies a set of data that is associated with a single sync adapter. This is empty by default, and is completely optional. It only needs to be populated if multiple sync adapters are entering distinct data for the same account type and account name. It should be set at the time the group is inserted and never changed afterwards. |
| String | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#TITLE` | read/write | The display title of this group. |
| String | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#NOTES` | read/write | Notes about the group. |
| String | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SYSTEM_ID` | read/write | The ID of this group if it is a System Group, i.e. a group that has a special meaning to the sync adapter, null otherwise. |
| int | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SUMMARY_COUNT` | read-only | The total number of `https://developer.android.com/reference/android/provider/ContactsContract.Contacts` that have `https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership` in this group. Read-only value that is only present when querying `https://developer.android.com/reference/android/provider/ContactsContract.Groups#CONTENT_SUMMARY_URI`. |
| int | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SUMMARY_WITH_PHONES` | read-only | The total number of `https://developer.android.com/reference/android/provider/ContactsContract.Contacts` that have both `https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership` in this group, and also have phone numbers. Read-only value that is only present when querying `https://developer.android.com/reference/android/provider/ContactsContract.Groups#CONTENT_SUMMARY_URI`. |
| int | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#GROUP_VISIBLE` | read-only | Flag indicating if the contacts belonging to this group should be visible in any user interface. Allowed values: 0 and 1. |
| int | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#DELETED` | read/write | The "deleted" flag: "0" by default, "1" if the row has been marked for deletion. When `https://developer.android.com/reference/android/content/ContentResolver#delete(android.net.Uri,%20android.os.Bundle)` is called on a group, it is marked for deletion. The sync adaptor deletes the group on the server and then calls ContactResolver.delete once more, this time setting the the `https://developer.android.com/reference/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER` query parameter to finalize the data removal. |
| int | `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SHOULD_SYNC` | read/write | Whether this group should be synced if the SYNC_EVERYTHING settings is false for this group's account. |

<br />

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/ContactsContract.Groups#CONTENT_ITEM_TYPE` The MIME type of a single group. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/provider/ContactsContract.Groups#CONTENT_TYPE` The MIME type of a directory of groups. |

### Inherited constants

From interface `https://developer.android.com/reference/android/provider/BaseColumns` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/BaseColumns#_COUNT`

The count of rows in a directory.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/BaseColumns#_ID`

The unique ID for a row.
From interface `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#AUTO_ADD`

Any newly created contacts will automatically be added to groups that have this flag set to true.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#DATA_SET`

The data set within the account that this group belongs to.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#DELETED`

The "deleted" flag: "0" by default, "1" if the row has been marked for deletion.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#FAVORITES`

When a contacts is marked as a favorites it will be automatically added to the groups that have this flag set, and when it is removed from favorites it will be removed from these groups.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#GROUP_IS_READ_ONLY`

The "read-only" flag: "0" by default, "1" if the row cannot be modified or deleted except by a sync adapter.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#GROUP_VISIBLE`

Flag indicating if the contacts belonging to this group should be visible in any user interface.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#NOTES`

Notes about the group.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#RES_PACKAGE`

The package name to use when creating `https://developer.android.com/reference/android/content/res/Resources` objects for this group.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SHOULD_SYNC`

Whether this group should be synced if the SYNC_EVERYTHING settings is false for this group's account.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SUMMARY_COUNT`

The total number of `https://developer.android.com/reference/android/provider/ContactsContract.Contacts` that have `https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership` in this group.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SUMMARY_WITH_PHONES`

The total number of `https://developer.android.com/reference/android/provider/ContactsContract.Contacts` that have both `https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership` in this group, and also have phone numbers.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SYSTEM_ID`

The ID of this group if it is a System Group, i.e.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#TITLE`

The display title of this group.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#TITLE_RES`

The display title of this group to load as a resource from `https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#RES_PACKAGE`, which may be localized.
From interface `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME`

The name of the account instance to which this row belongs, which when paired with `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE` identifies a specific account.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#ACCOUNT_TYPE`

The type of account to which this row belongs, which when paired with `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#ACCOUNT_NAME` identifies a specific account.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#DIRTY`

Flag indicating that `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#VERSION` has changed, and this row needs to be synchronized by its owning account.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#SOURCE_ID`

String that uniquely identifies this row to its source account.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#VERSION`

Version number that is updated whenever this row or its related data changes.
From interface `https://developer.android.com/reference/android/provider/ContactsContract.BaseSyncColumns` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.BaseSyncColumns#SYNC1`

Generic column for use by sync adapters.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.BaseSyncColumns#SYNC2`

Generic column for use by sync adapters.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.BaseSyncColumns#SYNC3`

Generic column for use by sync adapters.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/provider/ContactsContract.BaseSyncColumns#SYNC4`

Generic column for use by sync adapters.

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/net/Uri` | `https://developer.android.com/reference/android/provider/ContactsContract.Groups#CONTENT_SUMMARY_URI` The content:// style URI for this table joined with details data from `https://developer.android.com/reference/android/provider/ContactsContract.Data`. |
| ` public static final https://developer.android.com/reference/android/net/Uri` | `https://developer.android.com/reference/android/provider/ContactsContract.Groups#CONTENT_URI` The content:// style URI for this table |

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/android/content/EntityIterator` | ` https://developer.android.com/reference/android/provider/ContactsContract.Groups#newEntityIterator(android.database.Cursor)(https://developer.android.com/reference/android/database/Cursor cursor) ` |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### CONTENT_ITEM_TYPE

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String CONTENT_ITEM_TYPE
```

The MIME type of a single group.

<br />

Constant Value: "vnd.android.cursor.item/group"

### CONTENT_TYPE

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String CONTENT_TYPE
```

The MIME type of a directory of groups.

<br />

Constant Value: "vnd.android.cursor.dir/group"

## Fields

### CONTENT_SUMMARY_URI

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Uri CONTENT_SUMMARY_URI
```

The content:// style URI for this table joined with details data from `https://developer.android.com/reference/android/provider/ContactsContract.Data`.

<br />

### CONTENT_URI

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Uri CONTENT_URI
```

The content:// style URI for this table

<br />

## Public methods

### newEntityIterator

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static EntityIterator newEntityIterator (Cursor cursor)
```

<br />

<br />

| Parameters ||
|---|---|
| `cursor` | `Cursor` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/EntityIterator` | <br /> |