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

# SimContacts

*** ** * ** ***

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

```
class SimContacts
```

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

Class containing utility methods around determine what accounts in the ContactsProvider are related to the SIM cards in the device.

Apps interested in managing contacts from SIM cards can query the ContactsProvider using `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimContacts#getSimAccounts(android.content.ContentResolver)` to get all accounts that relate to SIM cards. They can also register a receiver for the `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimContacts#ACTION_SIM_ACCOUNTS_CHANGED:kotlin.String` broadcast to be notified when these accounts change.

## Summary

| Constants ||
|---|---|
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimContacts#ACTION_SIM_ACCOUNTS_CHANGED:kotlin.String` Broadcast Action: SIM accounts have changed, call `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimContacts#getSimAccounts(android.content.ContentResolver)` to get the latest. |

| Public methods ||
|---|---|
| static [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[ContactsContract.SimAccount](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimAccount)!\> | `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimContacts#getSimAccounts(android.content.ContentResolver)(contentResolver: https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#)` Returns all known SIM accounts. |

## Constants

### ACTION_SIM_ACCOUNTS_CHANGED

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

```
static val ACTION_SIM_ACCOUNTS_CHANGED: String
```

Broadcast Action: SIM accounts have changed, call `https://developer.android.com/reference/kotlin/android/provider/ContactsContract.SimContacts#getSimAccounts(android.content.ContentResolver)` to get the latest.

    Value: "android.provider.action.SIM_ACCOUNTS_CHANGED"

## Public methods

### getSimAccounts

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

```
static fun getSimAccounts(contentResolver: ContentResolver): MutableList<ContactsContract.SimAccount!>
```

Returns all known SIM accounts. May be empty but never null.

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