Share via


AccountManager.NewChooseAccountIntent Method

Definition

Overloads

NewChooseAccountIntent(Account, IList<Account>, String[], String, String, String[], Bundle)

Returns an intent to an Activity that prompts the user to choose from a list of accounts.

NewChooseAccountIntent(Account, IList<Account>, String[], Boolean, String, String, String[], Bundle)

Deprecated in favor of #newChooseAccountIntent(Account, List, String[], String, String, String[], Bundle).

NewChooseAccountIntent(Account, IList<Account>, String[], String, String, String[], Bundle)

Returns an intent to an Activity that prompts the user to choose from a list of accounts.

[Android.Runtime.Register("newChooseAccountIntent", "(Landroid/accounts/Account;Ljava/util/List;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;", "", ApiSince=23)]
public static Android.Content.Intent? NewChooseAccountIntent (Android.Accounts.Account? selectedAccount, System.Collections.Generic.IList<Android.Accounts.Account>? allowableAccounts, string[]? allowableAccountTypes, string? descriptionOverrideText, string? addAccountAuthTokenType, string[]? addAccountRequiredFeatures, Android.OS.Bundle? addAccountOptions);
[<Android.Runtime.Register("newChooseAccountIntent", "(Landroid/accounts/Account;Ljava/util/List;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;", "", ApiSince=23)>]
static member NewChooseAccountIntent : Android.Accounts.Account * System.Collections.Generic.IList<Android.Accounts.Account> * string[] * string * string * string[] * Android.OS.Bundle -> Android.Content.Intent

Parameters

selectedAccount
Account

if specified, indicates that the Account is the currently selected one, according to the caller's definition of selected.

allowableAccounts
IList<Account>

an optional List of accounts that are allowed to be shown. If not specified then this field will not limit the displayed accounts.

allowableAccountTypes
String[]

an optional string array of account types. These are used both to filter the shown accounts and to filter the list of account types that are shown when adding an account. If not specified then this field will not limit the displayed account types when adding an account.

descriptionOverrideText
String

if non-null this string is used as the description in the accounts chooser screen rather than the default

addAccountAuthTokenType
String

this string is passed as the #addAccount authTokenType parameter

addAccountRequiredFeatures
String[]

this string array is passed as the #addAccount requiredFeatures parameter

addAccountOptions
Bundle

This Bundle is passed as the #addAccount options parameter

Returns

an Intent that can be used to launch the ChooseAccount activity flow.

Attributes

Remarks

Returns an intent to an Activity that prompts the user to choose from a list of accounts. The caller will then typically start the activity by calling startActivityForResult(intent, ...);.

On success the activity returns a Bundle with the account name and type specified using keys #KEY_ACCOUNT_NAME and #KEY_ACCOUNT_TYPE. Chosen account is marked as #VISIBILITY_USER_MANAGED_VISIBLE to the caller (see #setAccountVisibility) and will be returned to it in consequent #getAccountsByType) calls.

The most common case is to call this with one account type, e.g.:

newChooseAccountIntent(null, null, new String[]{"com.google"}, null, null, null,
            null);

Java documentation for android.accounts.AccountManager.newChooseAccountIntent(android.accounts.Account, java.util.List<android.accounts.Account>, java.lang.String[], java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle).

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

NewChooseAccountIntent(Account, IList<Account>, String[], Boolean, String, String, String[], Bundle)

Deprecated in favor of #newChooseAccountIntent(Account, List, String[], String, String, String[], Bundle).

[Android.Runtime.Register("newChooseAccountIntent", "(Landroid/accounts/Account;Ljava/util/ArrayList;[Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;", "")]
public static Android.Content.Intent? NewChooseAccountIntent (Android.Accounts.Account? selectedAccount, System.Collections.Generic.IList<Android.Accounts.Account>? allowableAccounts, string[]? allowableAccountTypes, bool alwaysPromptForAccount, string? descriptionOverrideText, string? addAccountAuthTokenType, string[]? addAccountRequiredFeatures, Android.OS.Bundle? addAccountOptions);
[<Android.Runtime.Register("newChooseAccountIntent", "(Landroid/accounts/Account;Ljava/util/ArrayList;[Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;", "")>]
static member NewChooseAccountIntent : Android.Accounts.Account * System.Collections.Generic.IList<Android.Accounts.Account> * string[] * bool * string * string * string[] * Android.OS.Bundle -> Android.Content.Intent

Parameters

selectedAccount
Account

if specified, indicates that the Account is the currently selected one, according to the caller's definition of selected.

allowableAccounts
IList<Account>

an optional List of accounts that are allowed to be shown. If not specified then this field will not limit the displayed accounts.

allowableAccountTypes
String[]

an optional string array of account types. These are used both to filter the shown accounts and to filter the list of account types that are shown when adding an account. If not specified then this field will not limit the displayed account types when adding an account.

alwaysPromptForAccount
Boolean

boolean that is ignored.

descriptionOverrideText
String

if non-null this string is used as the description in the accounts chooser screen rather than the default

addAccountAuthTokenType
String

this string is passed as the #addAccount authTokenType parameter

addAccountRequiredFeatures
String[]

this string array is passed as the #addAccount requiredFeatures parameter

addAccountOptions
Bundle

This Bundle is passed as the #addAccount options parameter

Returns

an Intent that can be used to launch the ChooseAccount activity flow.

Attributes

Remarks

Deprecated in favor of #newChooseAccountIntent(Account, List, String[], String, String, String[], Bundle).

Returns an intent to an Activity that prompts the user to choose from a list of accounts. The caller will then typically start the activity by calling startActivityForResult(intent, ...);.

On success the activity returns a Bundle with the account name and type specified using keys #KEY_ACCOUNT_NAME and #KEY_ACCOUNT_TYPE. Chosen account is marked as #VISIBILITY_USER_MANAGED_VISIBLE to the caller (see #setAccountVisibility) and will be returned to it in consequent #getAccountsByType) calls.

The most common case is to call this with one account type, e.g.:

newChooseAccountIntent(null, null, new String[]{"com.google"}, false, null,
            null, null, null);

Java documentation for android.accounts.AccountManager.newChooseAccountIntent(android.accounts.Account, java.util.ArrayList<android.accounts.Account>, java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], android.os.Bundle).

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