AccountManager.GetAuthTokenByFeatures(String, String, String[], Activity, Bundle, Bundle, IAccountManagerCallback, Handler) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This convenience helper combines the functionality of #getAccountsByTypeAndFeatures,
#getAuthToken, and #addAccount.
[Android.Runtime.Register("getAuthTokenByFeatures", "(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/app/Activity;Landroid/os/Bundle;Landroid/os/Bundle;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetGetAuthTokenByFeatures_Ljava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Landroid_app_Activity_Landroid_os_Bundle_Landroid_os_Bundle_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler")]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_ACCOUNTS")]
public virtual Android.Accounts.IAccountManagerFuture? GetAuthTokenByFeatures (string? accountType, string? authTokenType, string[]? features, Android.App.Activity? activity, Android.OS.Bundle? addAccountOptions, Android.OS.Bundle? getAuthTokenOptions, Android.Accounts.IAccountManagerCallback? callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("getAuthTokenByFeatures", "(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/app/Activity;Landroid/os/Bundle;Landroid/os/Bundle;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetGetAuthTokenByFeatures_Ljava_lang_String_Ljava_lang_String_arrayLjava_lang_String_Landroid_app_Activity_Landroid_os_Bundle_Landroid_os_Bundle_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_ACCOUNTS")>]
abstract member GetAuthTokenByFeatures : string * string * string[] * Android.App.Activity * Android.OS.Bundle * Android.OS.Bundle * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture
override this.GetAuthTokenByFeatures : string * string * string[] * Android.App.Activity * Android.OS.Bundle * Android.OS.Bundle * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture
Parameters
- accountType
- String
The account type required (see #getAccountsByType), must not be
null
- authTokenType
- String
The desired auth token type (see #getAuthToken), must not be
null
- features
- String[]
Required features for the account (see
#getAccountsByTypeAndFeatures), may be null or empty
- activity
- Activity
The Activity context to use for launching new sub-Activities to
prompt to add an account, select an account, and/or enter a password, as necessary;
used only to call startActivity(); should not be null
- addAccountOptions
- Bundle
Authenticator-specific options to use for adding new accounts; may be null or empty
- getAuthTokenOptions
- Bundle
Authenticator-specific options to use for getting auth tokens; may be null or empty
- 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 at least the
following fields:
<ul>
<li>#KEY_ACCOUNT_NAME - the name of the account
<li>#KEY_ACCOUNT_TYPE - the type of the account
<li>#KEY_AUTHTOKEN - the auth token you wanted
</ul>
If an error occurred, <code data-dev-comment-type="c">AccountManagerFuture#getResult()</code> throws:
<ul>
<li><code data-dev-comment-type="c">AuthenticatorException</code> if no authenticator was registered for this
account type or the authenticator failed to respond
<li><code data-dev-comment-type="c">OperationCanceledException</code> if the operation was canceled for any reason,
including the user canceling any operation
<li><code data-dev-comment-type="c">IOException</code> if the authenticator experienced an I/O problem updating
settings, usually because of network trouble
</ul>
- Attributes
Remarks
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.