public final class GoogleAccountManager
Beta
Account manager wrapper for Google accounts.
Static Fields
ACCOUNT_TYPE
public static final String ACCOUNT_TYPE
Google account type.
Type | Description |
String |
Constructors
GoogleAccountManager(AccountManager accountManager)
public GoogleAccountManager(AccountManager accountManager)
Name | Description |
accountManager | android.accounts.AccountManager account manager |
GoogleAccountManager(Context context)
public GoogleAccountManager(Context context)
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.
Name | Description |
accountName | String Google account name or |
Type | Description |
android.accounts.Account | Google account or |
getAccountManager()
public AccountManager getAccountManager()
Returns the account manager.
Type | Description |
android.accounts.AccountManager |
getAccounts()
public Account[] getAccounts()
Returns all Google accounts.
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.
Name | Description |
authToken | String auth token |