# ContactsContract.Settings

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.Settings#constants)\|[Inherited Constants](https://developer.android.com/reference/android/provider/ContactsContract.Settings#inhconstants)\|[Fields](https://developer.android.com/reference/android/provider/ContactsContract.Settings#lfields)\|[Methods](https://developer.android.com/reference/android/provider/ContactsContract.Settings#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/provider/ContactsContract.Settings#inhmethods)  

# ContactsContract.Settings

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings "View this page in Kotlin")\|Java

`
public
static
final

class
ContactsContract.Settings
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[ContactsContract.SettingsColumns](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns)`


`

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

<br />

*** ** * ** ***

<br />

Contacts-specific settings for various[Account](https://developer.android.com/reference/android/accounts/Account)'s.

A settings entry for an account is created automatically when a raw contact or group is inserted that references it. Settings entries cannot be deleted as long as raw contacts or groups continue to reference it; in order to delete a settings entry all raw contacts and groups referencing the account must be deleted first.

## Columns

|                                                                                                                                                                                                                                                                                 Settings                                                                                                                                                                                                                                                                                  ||||
|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| String | [ContactsContract.SettingsColumns.ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ACCOUNT_NAME)                   | read/write-once | The name of the account instance to which this row belongs.                                                                                                                                                                                                                                                                                                           |
| String | [ContactsContract.SettingsColumns.ACCOUNT_TYPE](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ACCOUNT_TYPE)                   | read/write-once | The type of account to which this row belongs, which when paired with[ContactsContract.SettingsColumns.ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ACCOUNT_NAME)identifies a specific account.                                                                                                            |
| int    | [ContactsContract.SettingsColumns.SHOULD_SYNC](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#SHOULD_SYNC)                     | read/write      | Depending on the mode defined by the sync-adapter, this flag controls the top-level sync behavior for this data source.                                                                                                                                                                                                                                               |
| int    | [ContactsContract.SettingsColumns.UNGROUPED_VISIBLE](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#UNGROUPED_VISIBLE)         | read/write      | Flag indicating if contacts without any[CommonDataKinds.GroupMembership](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries should be visible in any user interface.                                                                                                                                   |
| int    | [ContactsContract.SettingsColumns.ANY_UNSYNCED](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ANY_UNSYNCED)                   | read-only       | Read-only flag indicating if this[ContactsContract.SettingsColumns.SHOULD_SYNC](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#SHOULD_SYNC)or any[Groups.SHOULD_SYNC](https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SHOULD_SYNC)under this account have been marked as unsynced. |
| int    | [ContactsContract.SettingsColumns.UNGROUPED_COUNT](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#UNGROUPED_COUNT)             | read-only       | Read-only count of[Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts)from a specific source that have no[CommonDataKinds.GroupMembership](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries.                                                               |
| int    | [ContactsContract.SettingsColumns.UNGROUPED_WITH_PHONES](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#UNGROUPED_WITH_PHONES) | read-only       | Read-only count of[Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts)from a specific source that have no[CommonDataKinds.GroupMembership](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries, and also have phone numbers.                                  |

<br />

## Summary

|                                                                                                                                                                     ### Constants                                                                                                                                                                      ||
|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_SET_DEFAULT_ACCOUNT](https://developer.android.com/reference/android/provider/ContactsContract.Settings#ACTION_SET_DEFAULT_ACCOUNT) Action used to launch the UI to set the default account for new contacts.                                                              |
| [String](https://developer.android.com/reference/java/lang/String) | [CONTENT_ITEM_TYPE](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_ITEM_TYPE) The MIME-type of[CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_URI)providing a single setting. |
| [String](https://developer.android.com/reference/java/lang/String) | [CONTENT_TYPE](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_TYPE) The MIME-type of[CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_URI)providing a directory of settings.    |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.provider.ContactsContract.SettingsColumns](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns) |--------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://developer.android.com/reference/java/lang/String) | [ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ACCOUNT_NAME) The name of the account instance to which this row belongs.                                                                                                                                                                                                                                                                                            | | [String](https://developer.android.com/reference/java/lang/String) | [ACCOUNT_TYPE](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ACCOUNT_TYPE) The type of account to which this row belongs, which when paired with[ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ACCOUNT_NAME)identifies a specific account.                                                                                                                              | | [String](https://developer.android.com/reference/java/lang/String) | [ANY_UNSYNCED](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#ANY_UNSYNCED) Read-only flag indicating if this[SHOULD_SYNC](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#SHOULD_SYNC)or any[Groups.SHOULD_SYNC](https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns#SHOULD_SYNC)under this account have been marked as unsynced.                   | | [String](https://developer.android.com/reference/java/lang/String) | [DATA_SET](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#DATA_SET) The data set within the account that this row belongs to.                                                                                                                                                                                                                                                                                                      | | [String](https://developer.android.com/reference/java/lang/String) | [SHOULD_SYNC](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#SHOULD_SYNC) Depending on the mode defined by the sync-adapter, this flag controls the top-level sync behavior for this data source.                                                                                                                                                                                                                                  | | [String](https://developer.android.com/reference/java/lang/String) | [UNGROUPED_COUNT](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#UNGROUPED_COUNT) Read-only count of[Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts)from a specific source that have no[CommonDataKinds.GroupMembership](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries.                                          | | [String](https://developer.android.com/reference/java/lang/String) | [UNGROUPED_VISIBLE](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#UNGROUPED_VISIBLE) Flag indicating if contacts without any[CommonDataKinds.GroupMembership](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries should be visible in any user interface.                                                                                                          | | [String](https://developer.android.com/reference/java/lang/String) | [UNGROUPED_WITH_PHONES](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns#UNGROUPED_WITH_PHONES) Read-only count of[Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts)from a specific source that have no[CommonDataKinds.GroupMembership](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries, and also have phone numbers. | |

|                                                                                                                  ### Fields                                                                                                                  ||
|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Uri](https://developer.android.com/reference/android/net/Uri) | [CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_URI) The content:// style URI for this table |

|                                                                                                                                                                                                                                                                                                                                                                                                                                    ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                    ||
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[Account](https://developer.android.com/reference/android/accounts/Account) | ` `[getDefaultAccount](https://developer.android.com/reference/android/provider/ContactsContract.Settings#getDefaultAccount(android.content.ContentResolver))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` resolver) ` *This method was deprecated in API level 36. This API is only supported up to Android version \*[Build.VERSION_CODES.VANILLA_ICE_CREAM](https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM). On later versions,[ContactsContract.RawContacts.DefaultAccount.getDefaultAccountForNewContacts](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.DefaultAccount#getDefaultAccountForNewContacts(android.content.ContentResolver))should be used.* |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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

### ACTION_SET_DEFAULT_ACCOUNT

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

```
public static final String ACTION_SET_DEFAULT_ACCOUNT
```

Action used to launch the UI to set the default account for new contacts.

<br />

Constant Value: "android.provider.action.SET_DEFAULT_ACCOUNT"  

### 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[CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_URI)providing a single setting.

<br />

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

### 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[CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Settings#CONTENT_URI)providing a directory of settings.

<br />

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

## Fields

### 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

### getDefaultAccount

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

```
public static Account getDefaultAccount (ContentResolver resolver)
```

<br />

**This method was deprecated in API level 36.**   
This API is only supported up to Android version \*[Build.VERSION_CODES.VANILLA_ICE_CREAM](https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM). On later versions,[ContactsContract.RawContacts.DefaultAccount.getDefaultAccountForNewContacts](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts.DefaultAccount#getDefaultAccountForNewContacts(android.content.ContentResolver))should be used.

Get the account that is set as the default account for new contacts, which should be initially selected when creating a new contact on contact management apps. If the setting has not been set by any app, it will return null. Once the setting is set to non-null Account, it can still be set to null in the future.

<br />

|                                           Parameters                                            ||
|------------|-------------------------------------------------------------------------------------|
| `resolver` | `ContentResolver`: the ContentResolver to query. This value cannot be`null`. <br /> |

|                                                                                  Returns                                                                                  ||
|-----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| [Account](https://developer.android.com/reference/android/accounts/Account) | the default account for new contacts, or null if it's not set or set to NULL account. <br /> |