AccountManager.GetAccountsByTypeForPackage(String, String) Method

Definition

Returns the accounts visible to the specified package in an environment where some apps are not authorized to view all accounts.

[Android.Runtime.Register("getAccountsByTypeForPackage", "(Ljava/lang/String;Ljava/lang/String;)[Landroid/accounts/Account;", "GetGetAccountsByTypeForPackage_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual Android.Accounts.Account[] GetAccountsByTypeForPackage (string? type, string? packageName);
[<Android.Runtime.Register("getAccountsByTypeForPackage", "(Ljava/lang/String;Ljava/lang/String;)[Landroid/accounts/Account;", "GetGetAccountsByTypeForPackage_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member GetAccountsByTypeForPackage : string * string -> Android.Accounts.Account[]
override this.GetAccountsByTypeForPackage : string * string -> Android.Accounts.Account[]

Parameters

type
String

The type of accounts to return, null to retrieve all accounts

packageName
String

The package name of the app for which the accounts are to be returned

Returns

Account[]

An array of Account, one per matching account. Empty (never null) if no accounts of the specified type can be accessed by the package.

Attributes

Remarks

Java documentation for android.accounts.AccountManager.getAccountsByTypeForPackage(java.lang.String, java.lang.String).

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