Stay organized with collections
Save and categorize content based on your preferences.
class 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 getSimAccounts(android.content.ContentResolver)
to get all accounts that relate to SIM cards. They can also register a receiver for the ACTION_SIM_ACCOUNTS_CHANGED
broadcast to be notified when these accounts change.
Summary
Constants
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ContactsContract.SimContacts\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSimContacts\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/provider/ContactsContract.SimContacts \"View this page in Java\") \n\n```\nclass SimContacts\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.provider.ContactsContract.SimContacts](#) |\n\nClass containing utility methods around determine what accounts in the ContactsProvider are related to the SIM cards in the device.\n\nApps interested in managing contacts from SIM cards can query the ContactsProvider using [getSimAccounts(android.content.ContentResolver)](#getSimAccounts(android.content.ContentResolver)) to get all accounts that relate to SIM cards. They can also register a receiver for the [ACTION_SIM_ACCOUNTS_CHANGED](#ACTION_SIM_ACCOUNTS_CHANGED:kotlin.String) broadcast to be notified when these accounts change.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ACTION_SIM_ACCOUNTS_CHANGED](#ACTION_SIM_ACCOUNTS_CHANGED:kotlin.String) Broadcast Action: SIM accounts have changed, call [getSimAccounts(android.content.ContentResolver)](#getSimAccounts(android.content.ContentResolver)) to get the latest. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[ContactsContract.SimAccount](/reference/kotlin/android/provider/ContactsContract.SimAccount)!\\\u003e | [getSimAccounts](#getSimAccounts(android.content.ContentResolver))`(`contentResolver:` `[ContentResolver](../content/ContentResolver.html#)`)` Returns all known SIM accounts. |\n\nConstants\n---------\n\n### ACTION_SIM_ACCOUNTS_CHANGED\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ACTION_SIM_ACCOUNTS_CHANGED: String\n```\n\nBroadcast Action: SIM accounts have changed, call [getSimAccounts(android.content.ContentResolver)](#getSimAccounts(android.content.ContentResolver)) to get the latest. \n\n Value: \"android.provider.action.SIM_ACCOUNTS_CHANGED\"\n\nPublic methods\n--------------\n\n### getSimAccounts\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun getSimAccounts(contentResolver: ContentResolver): MutableList\u003cContactsContract.SimAccount!\u003e\n```\n\nReturns all known SIM accounts. May be empty but never null.\n\n| Parameters ||\n|-------------------|--------------------------------------------------------------------------------------------------------------|\n| `contentResolver` | [ContentResolver](../content/ContentResolver.html#): content resolver to query. This value cannot be `null`. |"]]