Class GoogleAccountManager (2.6.0)

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
Type Description
String

Constructors

GoogleAccountManager(AccountManager accountManager)

public GoogleAccountManager(AccountManager accountManager)
Parameter
Name Description
accountManager android.accounts.AccountManager

account manager

GoogleAccountManager(Context context)

public GoogleAccountManager(Context context)
Parameter
Name Description
context android.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
Name Description
accountName String

Google account name or null for null result

Returns
Type Description
android.accounts.Account

Google account or null for none found or for null input

getAccountManager()

public AccountManager getAccountManager()

Returns the account manager.

Returns
Type Description
android.accounts.AccountManager

getAccounts()

public Account[] getAccounts()

Returns all Google accounts.

Returns
Type Description
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
Name Description
authToken String

auth token