Share via


AccountManager.RemoveAccountExplicitly(Account) Method

Definition

Removes an account directly.

[Android.Runtime.Register("removeAccountExplicitly", "(Landroid/accounts/Account;)Z", "GetRemoveAccountExplicitly_Landroid_accounts_Account_Handler", ApiSince=22)]
[Android.Runtime.RequiresPermission("android.permission.AUTHENTICATE_ACCOUNTS")]
public virtual bool RemoveAccountExplicitly (Android.Accounts.Account? account);
[<Android.Runtime.Register("removeAccountExplicitly", "(Landroid/accounts/Account;)Z", "GetRemoveAccountExplicitly_Landroid_accounts_Account_Handler", ApiSince=22)>]
[<Android.Runtime.RequiresPermission("android.permission.AUTHENTICATE_ACCOUNTS")>]
abstract member RemoveAccountExplicitly : Android.Accounts.Account -> bool
override this.RemoveAccountExplicitly : Android.Accounts.Account -> bool

Parameters

account
Account

The Account to delete.

Returns

True if the account was successfully deleted, false if the account did not exist, the account is null, or another error occurs.

Attributes

Remarks

Removes an account directly. Normally used by authenticators, not directly by applications. Does not delete the account from the server. The authenticator may have its own policies preventing account deletion, in which case the account will not be deleted.

It is safe to call this method from the main thread.

This method requires the caller to have a signature match with the authenticator that manages the specified account.

<b>NOTE:</b> If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator is needed for those platforms. See docs for this function in API level 22.

Java documentation for android.accounts.AccountManager.removeAccountExplicitly(android.accounts.Account).

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