Language

ContactsContract.Settings.SetAccountAttributes Method

Definition

Sets the attributes for a given account with a new set of flags.

[Android.Runtime.Register("setAccountAttributes", "(Landroid/content/ContentResolver;Landroid/accounts/Account;Ljava/lang/String;J)V", "", ApiSince=37)]
public static void SetAccountAttributes(Android.Content.ContentResolver resolver, Android.Accounts.Account? account, string? dataSet, long newAttributes);
[<Android.Runtime.Register("setAccountAttributes", "(Landroid/content/ContentResolver;Landroid/accounts/Account;Ljava/lang/String;J)V", "", ApiSince=37)>]
static member SetAccountAttributes : Android.Content.ContentResolver * Android.Accounts.Account * string * int64 -> unit

Parameters

resolver
ContentResolver

The ContentResolver to use for the update. This value cannot be null.

account
Account
dataSet
String

The data set within the account, which may be null.

newAttributes
Int64

The complete new bitmask of attributes to apply. Value is either 0 or a combination of the following: ContactsContract.Settings.AccountAttributes.ATTRIBUTE_DATA_ORIGIN_LOCAL; ContactsContract.Settings.AccountAttributes.ATTRIBUTE_DATA_ORIGIN_SIM; ContactsContract.Settings.AccountAttributes.ATTRIBUTE_DATA_ORIGIN_CLOUD; ContactsContract.Settings.AccountAttributes.ATTRIBUTE_SYNC_MODE_UP_SYNC; ContactsContract.Settings.AccountAttributes.ATTRIBUTE_SYNC_MODE_DOWN_SYNC; ContactsContract.Settings.AccountAttributes.ATTRIBUTE_DATA_TYPE_CUSTOM_DECLARED

Attributes

Remarks

Sets the attributes for a given account with a new set of flags.

Warning: This is a destructive operation. Any attributes previously set on the account will be cleared and replaced by the provided newAttributes.

The provided bitmask must be valid and free of semantic conflicts (e.g., containing more than one DATA_ORIGIN type). Security

This method requires that the calling application to be the authenticator for the account's type. Requires Manifest.permission.WRITE_CONTACTS

Android reference for android.provider.ContactsContract.Settings.setAccountAttributes.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to