Share via


AccountManager.StartUpdateCredentialsSession Method

Definition

Asks the user to enter a new password for the account but not updating the saved credentials for the account until #finishSession is called.

[Android.Runtime.Register("startUpdateCredentialsSession", "(Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;Landroid/app/Activity;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetStartUpdateCredentialsSession_Landroid_accounts_Account_Ljava_lang_String_Landroid_os_Bundle_Landroid_app_Activity_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler", ApiSince=26)]
public virtual Android.Accounts.IAccountManagerFuture? StartUpdateCredentialsSession (Android.Accounts.Account? account, string? authTokenType, Android.OS.Bundle? options, Android.App.Activity? activity, Android.Accounts.IAccountManagerCallback? callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("startUpdateCredentialsSession", "(Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;Landroid/app/Activity;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetStartUpdateCredentialsSession_Landroid_accounts_Account_Ljava_lang_String_Landroid_os_Bundle_Landroid_app_Activity_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler", ApiSince=26)>]
abstract member StartUpdateCredentialsSession : Android.Accounts.Account * string * Android.OS.Bundle * Android.App.Activity * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture
override this.StartUpdateCredentialsSession : Android.Accounts.Account * string * Android.OS.Bundle * Android.App.Activity * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture

Parameters

account
Account

The account to update credentials for

authTokenType
String

The credentials entered must allow an auth token of this type to be created (but no actual auth token is returned); may be null

options
Bundle

Authenticator-specific options for the request; may be null or empty

activity
Activity

The Activity context to use for launching a new authenticator-defined sub-Activity to prompt the user to enter a password; used only to call startActivity(); if null, the prompt will not be launched directly, but the necessary Intent will be returned to the caller instead

callback
IAccountManagerCallback

Callback to invoke when the request completes, null for no callback

handler
Handler

Handler identifying the callback thread, null for the main thread

Returns

An AccountManagerFuture which resolves to a Bundle with these fields if an activity was supplied and user was successfully re-authenticated to the account: <ul> <li>#KEY_ACCOUNT_SESSION_BUNDLE - encrypted Bundle for updating the local credentials on device later. <li>#KEY_ACCOUNT_STATUS_TOKEN - optional, token to check status of the account </ul> If no activity was specified, the returned Bundle contains #KEY_INTENT with the Intent needed to launch the password prompt. If an error occurred, AccountManagerFuture#getResult() throws: <ul> <li>AuthenticatorException if the authenticator failed to respond <li>OperationCanceledException if the operation was canceled for any reason, including the user canceling the password prompt <li>IOException if the authenticator experienced an I/O problem verifying the password, usually because of network trouble </ul>

Attributes

Remarks

Asks the user to enter a new password for the account but not updating the saved credentials for the account until #finishSession is called.

This method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.

<b>NOTE:</b> The saved credentials for the account alone will not be updated by calling this API alone. #finishSession should be called after this to update local credentials

Java documentation for android.accounts.AccountManager.startUpdateCredentialsSession(android.accounts.Account, java.lang.String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler).

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