Stay organized with collections
Save and categorize content based on your preferences.
DefaultAccount
class DefaultAccount
Class containing utility methods around the default account. New raw contacts requested to be inserted without a specified Account
will be saved in the default account.
Summary
Nested classes |
|
Represents the state of the default account, and the actual Account if it's a cloud account.
|
Constants |
static String |
Action used to launch the UI to move contacts to the default account.
|
Constants
static val ACTION_MOVE_CONTACTS_TO_DEFAULT_ACCOUNT: String
Action used to launch the UI to move contacts to the default account.
Value: "android.provider.action.MOVE_CONTACTS_TO_DEFAULT_ACCOUNT"
Public methods
static fun getDefaultAccountForNewContacts(resolver: ContentResolver): ContactsContract.RawContacts.DefaultAccount.DefaultAccountAndState
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.
Parameters |
resolver |
ContentResolver: the ContentResolver to query. This value cannot be null . |
Exceptions |
java.lang.RuntimeException |
if failed to look up the default account. |
java.lang.IllegalStateException |
if the default account is in an invalid state. |
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-01-23 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-01-23 UTC."],[],[]]