次の方法で共有


AccountManager.GetPassword(Account) Method

Definition

Gets the saved password associated with the account.

[Android.Runtime.Register("getPassword", "(Landroid/accounts/Account;)Ljava/lang/String;", "GetGetPassword_Landroid_accounts_Account_Handler")]
[Android.Runtime.RequiresPermission("android.permission.AUTHENTICATE_ACCOUNTS")]
public virtual string? GetPassword (Android.Accounts.Account? account);
[<Android.Runtime.Register("getPassword", "(Landroid/accounts/Account;)Ljava/lang/String;", "GetGetPassword_Landroid_accounts_Account_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.AUTHENTICATE_ACCOUNTS")>]
abstract member GetPassword : Android.Accounts.Account -> string
override this.GetPassword : Android.Accounts.Account -> string

Parameters

account
Account

The account to query for a password. Must not be null.

Returns

The account's password, null if none or if the account doesn't exist

Attributes

Remarks

Gets the saved password associated with the account. This is intended for authenticators and related code; applications should get an auth token instead.

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 owns the specified account.

<b>NOTE:</b> If targeting your app to work on API level android.os.Build.VERSION_CODES#LOLLIPOP_MR1 and before, AUTHENTICATE_ACCOUNTS permission is needed for those platforms. See docs for this function in API level android.os.Build.VERSION_CODES#LOLLIPOP_MR1.

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