Class GoogleAccountManager (1.35.1)

public final class GoogleAccountManager

Beta
Account manager wrapper for Google accounts.

Inheritance

java.lang.Object > GoogleAccountManager

Static Fields

ACCOUNT_TYPE

public static final String ACCOUNT_TYPE

Google account type.

Field Value
TypeDescription
String

Constructors

GoogleAccountManager(AccountManager accountManager)

public GoogleAccountManager(AccountManager accountManager)
Parameter
NameDescription
accountManagerandroid.accounts.AccountManager

account manager

GoogleAccountManager(Context context)

public GoogleAccountManager(Context context)
Parameter
NameDescription
contextandroid.content.Context

context from which to retrieve the account manager

Methods

getAccountByName(String accountName)

public Account getAccountByName(String accountName)

Returns the Google account of the given Account#name.

Parameter
NameDescription
accountNameString

Google account name or null for null result

Returns
TypeDescription
android.accounts.Account

Google account or null for none found or for null input

getAccountManager()

public AccountManager getAccountManager()

Returns the account manager.

Returns
TypeDescription
android.accounts.AccountManager

getAccounts()

public Account[] getAccounts()

Returns all Google accounts.

Returns
TypeDescription
android.accounts.Account[]

array of Google accounts

invalidateAuthToken(String authToken)

public void invalidateAuthToken(String authToken)

Invalidates the given Google auth token by removing it from the account manager's cache (if necessary) for example if the auth token has expired or otherwise become invalid.

Parameter
NameDescription
authTokenString

auth token