# ContactsContract.Settings

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

# Settings

*** ** * ** ***

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

```
class Settings : ContactsContract.SettingsColumns
```

|---|------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                           ||
| ↳ | [android.provider.ContactsContract.Settings](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#) |

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

## Summary

|                                                                                                                                                                                                       Constants                                                                                                                                                                                                        ||
|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACTION_SET_DEFAULT_ACCOUNT](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#ACTION_SET_DEFAULT_ACCOUNT:kotlin.String) Action used to launch the UI to set the default account for new contacts.                                                                                     |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTENT_ITEM_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_ITEM_TYPE:kotlin.String) The MIME-type of[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_URI:android.net.Uri)providing a single setting. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CONTENT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_TYPE:kotlin.String) The MIME-type of[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_URI:android.net.Uri)providing a directory of settings.    |

| Inherited constants ||
|---|---|
| From class[SettingsColumns](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns) |----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#ACCOUNT_NAME:kotlin.String) <br /> The name of the account instance to which this row belongs. Type: TEXT <br />                                                                                                                                                                                                                                                                                                             | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACCOUNT_TYPE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#ACCOUNT_TYPE:kotlin.String) <br /> The type of account to which this row belongs, which when paired with[ACCOUNT_NAME](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#ACCOUNT_NAME:kotlin.String)identifies a specific account. Type: TEXT <br />                                                                                                                          | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ANY_UNSYNCED](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#ANY_UNSYNCED:kotlin.String) <br /> Read-only flag indicating if this[SHOULD_SYNC](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#SHOULD_SYNC:kotlin.String)or any[Groups.SHOULD_SYNC](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.GroupsColumns#SHOULD_SYNC:kotlin.String)under this account have been marked as unsynced. <br />     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DATA_SET](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#DATA_SET:kotlin.String) <br /> The data set within the account that this row belongs to. This allows multiple sync adapters for the same account type to distinguish between each others' data. 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. Type: TEXT <br />                           | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [SHOULD_SYNC](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#SHOULD_SYNC:kotlin.String) <br /> Depending on the mode defined by the sync-adapter, this flag controls the top-level sync behavior for this data source. Type: INTEGER (boolean) <br />                                                                                                                                                                                                                                      | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [UNGROUPED_COUNT](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#UNGROUPED_COUNT:kotlin.String) <br /> Read-only count of[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)from a specific source that have no[CommonDataKinds.GroupMembership](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries. Type: INTEGER <br />                                          | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [UNGROUPED_VISIBLE](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#UNGROUPED_VISIBLE:kotlin.String) <br /> Flag indicating if contacts without any[CommonDataKinds.GroupMembership](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries should be visible in any user interface. Type: INTEGER (boolean) <br />                                                                                                       | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [UNGROUPED_WITH_PHONES](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SettingsColumns#UNGROUPED_WITH_PHONES:kotlin.String) <br /> Read-only count of[Contacts](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts)from a specific source that have no[CommonDataKinds.GroupMembership](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.GroupMembership)entries, and also have phone numbers. Type: INTEGER <br /> | ||

|                                                                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                                                                        ||
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Account](https://developer.android.com/reference/kotlin/android/accounts/Account.html#)? | [getDefaultAccount](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#getDefaultAccount(android.content.ContentResolver))`(`resolver:` `[ContentResolver](https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#)`)` 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. |

|                                                                                                                            Properties                                                                                                                            ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | [CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_URI:android.net.Uri) The content:// style URI for this table |

## Constants

### ACTION_SET_DEFAULT_ACCOUNT

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

```
static val ACTION_SET_DEFAULT_ACCOUNT: String
```

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

    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.html#ApiLevels)  

```
static val CONTENT_ITEM_TYPE: String
```

The MIME-type of[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_URI:android.net.Uri)providing a single setting.  

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

### CONTENT_TYPE

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

```
static val CONTENT_TYPE: String
```

The MIME-type of[CONTENT_URI](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Settings#CONTENT_URI:android.net.Uri)providing a directory of settings.  

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

## Public methods

### getDefaultAccount

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

```
static fun getDefaultAccount(resolver: ContentResolver): Account?
```

**Deprecated:** *This API is only supported up to Android version \*[Build.VERSION_CODES.VANILLA_ICE_CREAM](https://developer.android.com/reference/kotlin/android/os/Build.VERSION_CODES.html#VANILLA_ICE_CREAM:kotlin.Int). On later versions,[ContactsContract.RawContacts.DefaultAccount.getDefaultAccountForNewContacts](https://developer.android.com/reference/kotlin/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.

|                                                                                  Parameters                                                                                   ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `resolver` | [ContentResolver](https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#):the ContentResolver to query. This value cannot be`null`. |

|                                                                                      Return                                                                                      ||
|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [Account](https://developer.android.com/reference/kotlin/android/accounts/Account.html#)? | the default account for new contacts, or null if it's not set or set to NULL account. |

## Properties

### CONTENT_URI

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

```
static val CONTENT_URI: Uri!
```

The content:// style URI for this table