Freigeben über


AccountManager.ClearPassword(Account) Method

Definition

Forgets a saved password.

[Android.Runtime.Register("clearPassword", "(Landroid/accounts/Account;)V", "GetClearPassword_Landroid_accounts_Account_Handler")]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_ACCOUNTS")]
public virtual void ClearPassword (Android.Accounts.Account? account);
[<Android.Runtime.Register("clearPassword", "(Landroid/accounts/Account;)V", "GetClearPassword_Landroid_accounts_Account_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_ACCOUNTS")>]
abstract member ClearPassword : Android.Accounts.Account -> unit
override this.ClearPassword : Android.Accounts.Account -> unit

Parameters

account
Account

The account whose password to clear

Attributes

Remarks

Forgets a saved password. This erases the local copy of the password; it does not change the user's account password on the server. Has the same effect as setPassword(account, null) but requires fewer permissions, and may be used by applications or management interfaces to "sign out" from an account.

This method only successfully clear the account's password when the caller has the same signature as the authenticator that owns the specified account. Otherwise, this method will silently fail.

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

<b>NOTE:</b> If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those platforms. See docs for this function in API level 22.

Java documentation for android.accounts.AccountManager.clearPassword(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