Share via


AccountManager.GetAccountsByTypeAndFeatures Method

Definition

Lists all accounts of a type which have certain features.

[Android.Runtime.Register("getAccountsByTypeAndFeatures", "(Ljava/lang/String;[Ljava/lang/String;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetGetAccountsByTypeAndFeatures_Ljava_lang_String_arrayLjava_lang_String_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler")]
public virtual Android.Accounts.IAccountManagerFuture? GetAccountsByTypeAndFeatures (string? type, string[]? features, Android.Accounts.IAccountManagerCallback? callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("getAccountsByTypeAndFeatures", "(Ljava/lang/String;[Ljava/lang/String;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetGetAccountsByTypeAndFeatures_Ljava_lang_String_arrayLjava_lang_String_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler")>]
abstract member GetAccountsByTypeAndFeatures : string * string[] * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture
override this.GetAccountsByTypeAndFeatures : string * string[] * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture

Parameters

type
String

The type of accounts to return, must not be null

features
String[]

An array of the account features to require, 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 an array of Account, one per account of the specified type which matches the requested features.

Attributes

Remarks

Lists all accounts of a type which have certain features. The account type identifies the authenticator (see #getAccountsByType). Account features are authenticator-specific string tokens identifying boolean account properties (see #hasFeatures).

Unlike #getAccountsByType, this method calls the authenticator, which may contact the server or do other work to check account features, so the method returns an AccountManagerFuture.

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

Caller targeting API level android.os.Build.VERSION_CODES#O and above, will get list of accounts made visible to it by user (see #newChooseAccountIntent(Account, List, String[], String, String, String[], Bundle)) or AbstractAccountAuthenticator using #setAccountVisibility. android.Manifest.permission#GET_ACCOUNTS permission is not used.

Caller targeting API level below android.os.Build.VERSION_CODES#O that have not been granted the android.Manifest.permission#GET_ACCOUNTS permission, will only see those accounts managed by AbstractAccountAuthenticators whose signature matches the client.

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

Java documentation for android.accounts.AccountManager.getAccountsByTypeAndFeatures(java.lang.String, java.lang.String[], android.accounts.AccountManagerCallback<android.accounts.Account[]>, 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