AccountManager.AddAccountExplicitly Method

Definition

Overloads

AddAccountExplicitly(Account, String, Bundle)

Adds an account directly to the AccountManager.

AddAccountExplicitly(Account, String, Bundle, IDictionary<String,Integer>)

Adds an account directly to the AccountManager.

AddAccountExplicitly(Account, String, Bundle)

Adds an account directly to the AccountManager.

[Android.Runtime.Register("addAccountExplicitly", "(Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)Z", "GetAddAccountExplicitly_Landroid_accounts_Account_Ljava_lang_String_Landroid_os_Bundle_Handler")]
[Android.Runtime.RequiresPermission("android.permission.AUTHENTICATE_ACCOUNTS")]
public virtual bool AddAccountExplicitly (Android.Accounts.Account? account, string? password, Android.OS.Bundle? userdata);
[<Android.Runtime.Register("addAccountExplicitly", "(Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)Z", "GetAddAccountExplicitly_Landroid_accounts_Account_Ljava_lang_String_Landroid_os_Bundle_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.AUTHENTICATE_ACCOUNTS")>]
abstract member AddAccountExplicitly : Android.Accounts.Account * string * Android.OS.Bundle -> bool
override this.AddAccountExplicitly : Android.Accounts.Account * string * Android.OS.Bundle -> bool

Parameters

account
Account

The Account to add

password
String

The password to associate with the account, null for none

userdata
Bundle

String values to use for the account's userdata, null for none

Returns

Boolean

True if the account was successfully added, false if the account already exists, the account is null, the user is locked, or another error occurs.

Attributes

Remarks

Java documentation for android.accounts.AccountManager.addAccountExplicitly(android.accounts.Account, java.lang.String, android.os.Bundle).

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

AddAccountExplicitly(Account, String, Bundle, IDictionary<String,Integer>)

Adds an account directly to the AccountManager.

[Android.Runtime.Register("addAccountExplicitly", "(Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;Ljava/util/Map;)Z", "GetAddAccountExplicitly_Landroid_accounts_Account_Ljava_lang_String_Landroid_os_Bundle_Ljava_util_Map_Handler", ApiSince=26)]
public virtual bool AddAccountExplicitly (Android.Accounts.Account? account, string? password, Android.OS.Bundle? extras, System.Collections.Generic.IDictionary<string,Java.Lang.Integer>? visibility);
[<Android.Runtime.Register("addAccountExplicitly", "(Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;Ljava/util/Map;)Z", "GetAddAccountExplicitly_Landroid_accounts_Account_Ljava_lang_String_Landroid_os_Bundle_Ljava_util_Map_Handler", ApiSince=26)>]
abstract member AddAccountExplicitly : Android.Accounts.Account * string * Android.OS.Bundle * System.Collections.Generic.IDictionary<string, Java.Lang.Integer> -> bool
override this.AddAccountExplicitly : Android.Accounts.Account * string * Android.OS.Bundle * System.Collections.Generic.IDictionary<string, Java.Lang.Integer> -> bool

Parameters

account
Account

The Account to add

password
String

The password to associate with the account, null for none

extras
Bundle

String values to use for the account's userdata, null for none

visibility
IDictionary<String,Integer>

Map from packageName to visibility values which will be set before account is added. See #getAccountVisibility for possible values.

Returns

Boolean

True if the account was successfully added, false if the account already exists, the account is null, or another error occurs.

Attributes

Remarks

Java documentation for android.accounts.AccountManager.addAccountExplicitly(android.accounts.Account, java.lang.String, android.os.Bundle, java.util.Map<java.lang.String, java.lang.Integer>).

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