IT. Expert System.

Android Reference

AccountManager


android.accounts

Class AccountManager



  • public class AccountManager
    extends Object
    This class provides access to a centralized registry of the user's online accounts. The user enters credentials (username and password) once per account, granting applications access to online resources with "one-click" approval.

    Different online services have different ways of handling accounts and authentication, so the account manager uses pluggable authenticator modules for different account types. Authenticators (which may be written by third parties) handle the actual details of validating account credentials and storing account information. For example, Google, Facebook, and Microsoft Exchange each have their own authenticator.

    Many servers support some notion of an authentication token, which can be used to authenticate a request to the server without sending the user's actual password. (Auth tokens are normally created with a separate request which does include the user's credentials.) AccountManager can generate auth tokens for applications, so the application doesn't need to handle passwords directly. Auth tokens are normally reusable and cached by AccountManager, but must be refreshed periodically. It's the responsibility of applications to invalidate auth tokens when they stop working so the AccountManager knows it needs to regenerate them.

    Applications accessing a server normally go through these steps:

    Some AccountManager methods may need to interact with the user to prompt for credentials, present options, or ask the user to add an account. The caller may choose whether to allow AccountManager to directly launch the necessary user interface and wait for the user, or to return an Intent which the caller may use to launch the interface, or (in some cases) to install a notification which the user can select at any time to launch the interface. To have AccountManager launch the interface directly, the caller must supply the current foreground Activity context.

    Many AccountManager methods take AccountManagerCallback and Handler as parameters. These methods return immediately and run asynchronously. If a callback is provided then AccountManagerCallback.run(android.accounts.AccountManagerFuture<V>) will be invoked on the Handler's thread when the request completes, successfully or not. The result is retrieved by calling AccountManagerFuture.getResult() on the AccountManagerFuture returned by the method (and also passed to the callback). This method waits for the operation to complete (if necessary) and either returns the result or throws an exception if an error occurred during the operation. To make the request synchronously, call AccountManagerFuture.getResult() immediately on receiving the future from the method; no callback need be supplied.

    Requests which may block, including AccountManagerFuture.getResult(), must never be called on the application's main event thread. These operations throw IllegalStateException if they are used on the main thread.

    • Constructor Detail

      • AccountManager

        public AccountManager(Context context,
                      IAccountManager service)
      • AccountManager

        public AccountManager(Context context,
                      IAccountManager service,
                      Handler handler)
    • Method Detail

      • sanitizeResult

        public static Bundle sanitizeResult(Bundle result)
      • getPassword

        public String getPassword(Account account)
        Gets the saved password associated with the account. This is intended for authenticators and related code; applications should get an auth token instead.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.

        Parameters:
        account - The account to query for a password
        Returns:
        The account's password, null if none or if the account doesn't exist
      • getUserData

        public String getUserData(Account account,
                         String key)
        Gets the user data named by "key" associated with the account. This is intended for authenticators and related code to store arbitrary metadata along with accounts. The meaning of the keys and values is up to the authenticator for the account.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.

        Parameters:
        account - The account to query for user data
        Returns:
        The user data, null if the account or key doesn't exist
      • getAuthenticatorTypes

        public AuthenticatorDescription[] getAuthenticatorTypes()
        Lists the currently registered authenticators.

        It is safe to call this method from the main thread.

        No permission is required to call this method.

        Returns:
        An array of AuthenticatorDescription for every authenticator known to the AccountManager service. Empty (never null) if no authenticators are known.
      • getAccounts

        public Account[] getAccounts()
        Lists all accounts of any type registered on the device. Equivalent to getAccountsByType(null).

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#GET_ACCOUNTS.

        Returns:
        An array of Account, one for each account. Empty (never null) if no accounts have been added.
      • getAccountsByType

        public Account[] getAccountsByType(String type)
        Lists all accounts of a particular type. The account type is a string token corresponding to the authenticator and useful domain of the account. For example, there are types corresponding to Google and Facebook. The exact string token to use will be published somewhere associated with the authenticator in question.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#GET_ACCOUNTS.

        Parameters:
        type - The type of accounts to return, null to retrieve all accounts
        Returns:
        An array of Account, one per matching account. Empty (never null) if no accounts of the specified type have been added.
      • updateAppPermission

        public void updateAppPermission(Account account,
                               String authTokenType,
                               int uid,
                               boolean value)
        Change whether or not an app (identified by its uid) is allowed to retrieve an authToken for an account.

        This is only meant to be used by system activities and is not in the SDK.

        Parameters:
        account - The account whose permissions are being modified
        authTokenType - The type of token whose permissions are being modified
        uid - The uid that identifies the app which is being granted or revoked permission.
        value - true is permission is being granted, false for revoked
      • getAuthTokenLabel

        public AccountManagerFuture<String> getAuthTokenLabel(String accountType,
                                                     String authTokenType,
                                                     AccountManagerCallback<String> callback,
                                                     Handler handler)
        Get the user-friendly label associated with an authenticator's auth token.
        Parameters:
        accountType - the type of the authenticator. must not be null.
        authTokenType - the token type. must not be null.
        callback - callback to invoke when the result is available. may be null.
        handler - the handler on which to invoke the callback, or null for the main thread
        Returns:
        a future containing the label string
      • hasFeatures

        public AccountManagerFuture<Boolean> hasFeatures(Account account,
                                                String[] features,
                                                AccountManagerCallback<Boolean> callback,
                                                Handler handler)
        Finds out whether a particular account has all the specified features. Account features are authenticator-specific string tokens identifying boolean account properties. For example, features are used to tell whether Google accounts have a particular service (such as Google Calendar or Google Talk) enabled. The feature names and their meanings are published somewhere associated with the authenticator in question.

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

        This method requires the caller to hold the permission android.Manifest.permission#GET_ACCOUNTS.

        Parameters:
        account - The Account to test
        features - An array of the account features to check
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Boolean, true if the account exists and has all of the specified features.
      • addAccountExplicitly

        public boolean addAccountExplicitly(Account account,
                                   String password,
                                   Bundle userdata)
        Adds an account directly to the AccountManager. Normally used by sign-up wizards associated with authenticators, not directly by applications.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and to have the same UID as the added account's authenticator.

        Parameters:
        account - The Account to add
        password - The password to associate with the account, null for none
        userdata - String values to use for the account's userdata, null for none
        Returns:
        True if the account was successfully added, false if the account already exists, the account is null, or another error occurs.
      • removeAccount

        public AccountManagerFuture<Boolean> removeAccount(Account account,
                                                  AccountManagerCallback<Boolean> callback,
                                                  Handler handler)
        Removes an account from the AccountManager. Does nothing if the account does not exist. Does not delete the account from the server. The authenticator may have its own policies preventing account deletion, in which case the account will not be deleted.

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

        This method requires the caller to hold the permission android.Manifest.permission#MANAGE_ACCOUNTS.

        Parameters:
        account - The Account to remove
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Boolean, true if the account has been successfully removed, false if the authenticator forbids deleting this account.
      • invalidateAuthToken

        public void invalidateAuthToken(String accountType,
                               String authToken)
        Removes an auth token from the AccountManager's cache. Does nothing if the auth token is not currently in the cache. Applications must call this method when the auth token is found to have expired or otherwise become invalid for authenticating requests. The AccountManager does not validate or expire cached auth tokens otherwise.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#MANAGE_ACCOUNTS or android.Manifest.permission#USE_CREDENTIALS

        Parameters:
        accountType - The account type of the auth token to invalidate, must not be null
        authToken - The auth token to invalidate, may be null
      • peekAuthToken

        public String peekAuthToken(Account account,
                           String authTokenType)
        Gets an auth token from the AccountManager's cache. If no auth token is cached for this account, null will be returned -- a new auth token will not be generated, and the server will not be contacted. Intended for use by the authenticator, not directly by applications.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.

        Parameters:
        account - The account to fetch an auth token for
        authTokenType - The type of auth token to fetch, see {#getAuthToken}
        Returns:
        The cached auth token for this account and type, or null if no auth token is cached or the account does not exist.
      • setPassword

        public void setPassword(Account account,
                       String password)
        Sets or forgets a saved password. This modifies the local copy of the password used to automatically authenticate the user; it does not change the user's account password on the server. Intended for use by the authenticator, not directly by applications.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and have the same UID as the account's authenticator.

        Parameters:
        account - The account to set a password for
        password - The password to set, null to clear the password
      • clearPassword

        public void clearPassword(Account account)
        Forgets a saved password. This erases the local copy of the password; it does not change the user's account password on the server. Has the same effect as setPassword(account, null) but requires fewer permissions, and may be used by applications or management interfaces to "sign out" from an account.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#MANAGE_ACCOUNTS

        Parameters:
        account - The account whose password to clear
      • setUserData

        public void setUserData(Account account,
                       String key,
                       String value)
        Sets one userdata key for an account. Intended by use for the authenticator to stash state for itself, not directly by applications. The meaning of the keys and values is up to the authenticator.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.

        Parameters:
        account - The account to set the userdata for
        key - The userdata key to set. Must not be null
        value - The value to set, null to clear this userdata key
      • setAuthToken

        public void setAuthToken(Account account,
                        String authTokenType,
                        String authToken)
        Adds an auth token to the AccountManager cache for an account. If the account does not exist then this call has no effect. Replaces any previous auth token for this account and auth token type. Intended for use by the authenticator, not directly by applications.

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#AUTHENTICATE_ACCOUNTS and to have the same UID as the account's authenticator.

        Parameters:
        account - The account to set an auth token for
        authTokenType - The type of the auth token, see {#getAuthToken}
        authToken - The auth token to add to the cache
      • blockingGetAuthToken

        public String blockingGetAuthToken(Account account,
                                  String authTokenType,
                                  boolean notifyAuthFailure)
                                    throws OperationCanceledException,
                                           IOException,
                                           AuthenticatorException
        This convenience helper synchronously gets an auth token with getAuthToken(Account, String, boolean, AccountManagerCallback, Handler).

        This method may block while a network request completes, and must never be made from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#USE_CREDENTIALS.

        Parameters:
        account - The account to fetch an auth token for
        authTokenType - The auth token type, see {#link getAuthToken}
        notifyAuthFailure - If true, display a notification and return null if authentication fails; if false, prompt and wait for the user to re-enter correct credentials before returning
        Returns:
        An auth token of the specified type for this account, or null if authentication fails or none can be fetched.
        Throws:
        AuthenticatorException - if the authenticator failed to respond
        OperationCanceledException - if the request was canceled for any reason, including the user canceling a credential request
        IOException - if the authenticator experienced an I/O problem creating a new auth token, usually because of network trouble
      • getAuthToken

        public AccountManagerFuture<Bundle> getAuthToken(Account account,
                                                String authTokenType,
                                                Bundle options,
                                                Activity activity,
                                                AccountManagerCallback<Bundle> callback,
                                                Handler handler)
        Gets an auth token of the specified type for a particular account, prompting the user for credentials if necessary. This method is intended for applications running in the foreground where it makes sense to ask the user directly for a password.

        If a previously generated auth token is cached for this account and type, then it is returned. Otherwise, if a saved password is available, it is sent to the server to generate a new auth token. Otherwise, the user is prompted to enter a password.

        Some authenticators have auth token types, whose value is authenticator-dependent. Some services use different token types to access different functionality -- for example, Google uses different auth tokens to access Gmail and Google Calendar for the same account.

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

        This method requires the caller to hold the permission android.Manifest.permission#USE_CREDENTIALS.

        Parameters:
        account - The account to fetch an auth token for
        authTokenType - The auth token type, an authenticator-dependent string token, must not be null
        options - Authenticator-specific options for the request, may be null or empty
        activity - The Activity context to use for launching a new authenticator-defined sub-Activity to prompt the user for a password if necessary; used only to call startActivity(); must not be null.
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Bundle with at least the following fields: (Other authenticator-specific values may be returned.) If an auth token could not be fetched, AccountManagerFuture.getResult() throws:
        • AuthenticatorException if the authenticator failed to respond
        • OperationCanceledException if the operation is canceled for any reason, incluidng the user canceling a credential request
        • IOException if the authenticator experienced an I/O problem creating a new auth token, usually because of network trouble
        If the account is no longer present on the device, the return value is authenticator-dependent. The caller should verify the validity of the account before requesting an auth token.
      • getAuthToken

        @Deprecated
        public AccountManagerFuture<Bundle> getAuthToken(Account account,
                                                           String authTokenType,
                                                           boolean notifyAuthFailure,
                                                           AccountManagerCallback<Bundle> callback,
                                                           Handler handler)
        Gets an auth token of the specified type for a particular account, optionally raising a notification if the user must enter credentials. This method is intended for background tasks and services where the user should not be immediately interrupted with a password prompt.

        If a previously generated auth token is cached for this account and type, then it is returned. Otherwise, if a saved password is available, it is sent to the server to generate a new auth token. Otherwise, an Intent is returned which, when started, will prompt the user for a password. If the notifyAuthFailure parameter is set, a status bar notification is also created with the same Intent, alerting the user that they need to enter a password at some point.

        In that case, you may need to wait until the user responds, which could take hours or days or forever. When the user does respond and supply a new password, the account manager will broadcast the LOGIN_ACCOUNTS_CHANGED_ACTION Intent, which applications can use to try again.

        If notifyAuthFailure is not set, it is the application's responsibility to launch the returned Intent at some point. Either way, the result from this call will not wait for user action.

        Some authenticators have auth token types, whose value is authenticator-dependent. Some services use different token types to access different functionality -- for example, Google uses different auth tokens to access Gmail and Google Calendar for the same account.

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

        This method requires the caller to hold the permission android.Manifest.permission#USE_CREDENTIALS.

        Parameters:
        account - The account to fetch an auth token for
        authTokenType - The auth token type, an authenticator-dependent string token, must not be null
        notifyAuthFailure - True to add a notification to prompt the user for a password if necessary, false to leave that to the caller
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Bundle with at least the following fields on success: (Other authenticator-specific values may be returned.) If the user must enter credentials, the returned Bundle contains only KEY_INTENT with the Intent needed to launch a prompt. If an error occurred, AccountManagerFuture.getResult() throws:
        • AuthenticatorException if the authenticator failed to respond
        • OperationCanceledException if the operation is canceled for any reason, incluidng the user canceling a credential request
        • IOException if the authenticator experienced an I/O problem creating a new auth token, usually because of network trouble
        If the account is no longer present on the device, the return value is authenticator-dependent. The caller should verify the validity of the account before requesting an auth token.
      • getAuthToken

        public AccountManagerFuture<Bundle> getAuthToken(Account account,
                                                String authTokenType,
                                                Bundle options,
                                                boolean notifyAuthFailure,
                                                AccountManagerCallback<Bundle> callback,
                                                Handler handler)
        Gets an auth token of the specified type for a particular account, optionally raising a notification if the user must enter credentials. This method is intended for background tasks and services where the user should not be immediately interrupted with a password prompt.

        If a previously generated auth token is cached for this account and type, then it is returned. Otherwise, if a saved password is available, it is sent to the server to generate a new auth token. Otherwise, an Intent is returned which, when started, will prompt the user for a password. If the notifyAuthFailure parameter is set, a status bar notification is also created with the same Intent, alerting the user that they need to enter a password at some point.

        In that case, you may need to wait until the user responds, which could take hours or days or forever. When the user does respond and supply a new password, the account manager will broadcast the LOGIN_ACCOUNTS_CHANGED_ACTION Intent, which applications can use to try again.

        If notifyAuthFailure is not set, it is the application's responsibility to launch the returned Intent at some point. Either way, the result from this call will not wait for user action.

        Some authenticators have auth token types, whose value is authenticator-dependent. Some services use different token types to access different functionality -- for example, Google uses different auth tokens to access Gmail and Google Calendar for the same account.

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

        This method requires the caller to hold the permission android.Manifest.permission#USE_CREDENTIALS.

        Parameters:
        account - The account to fetch an auth token for
        authTokenType - The auth token type, an authenticator-dependent string token, must not be null
        options - Authenticator-specific options for the request, may be null or empty
        notifyAuthFailure - True to add a notification to prompt the user for a password if necessary, false to leave that to the caller
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Bundle with at least the following fields on success: (Other authenticator-specific values may be returned.) If the user must enter credentials, the returned Bundle contains only KEY_INTENT with the Intent needed to launch a prompt. If an error occurred, AccountManagerFuture.getResult() throws:
        • AuthenticatorException if the authenticator failed to respond
        • OperationCanceledException if the operation is canceled for any reason, incluidng the user canceling a credential request
        • IOException if the authenticator experienced an I/O problem creating a new auth token, usually because of network trouble
        If the account is no longer present on the device, the return value is authenticator-dependent. The caller should verify the validity of the account before requesting an auth token.
      • confirmCredentials

        public AccountManagerFuture<Bundle> confirmCredentials(Account account,
                                                      Bundle options,
                                                      Activity activity,
                                                      AccountManagerCallback<Bundle> callback,
                                                      Handler handler)
        Confirms that the user knows the password for an account to make extra sure they are the owner of the account. The user-entered password can be supplied directly, otherwise the authenticator for this account type prompts the user with the appropriate interface. This method is intended for applications which want extra assurance; for example, the phone lock screen uses this to let the user unlock the phone with an account password if they forget the lock pattern.

        If the user-entered password matches a saved password for this account, the request is considered valid; otherwise the authenticator verifies the password (usually by contacting the server).

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

        This method requires the caller to hold the permission android.Manifest.permission#MANAGE_ACCOUNTS.

        Parameters:
        account - The account to confirm password knowledge for
        options - Authenticator-specific options for the request; if the KEY_PASSWORD string field is present, the authenticator may use it directly rather than prompting the user; may be null or empty
        activity - The Activity context to use for launching a new authenticator-defined sub-Activity to prompt the user to enter a password; used only to call startActivity(); if null, the prompt will not be launched directly, but the necessary Intent will be returned to the caller instead
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Bundle with these fields if activity or password was supplied and the account was successfully verified: If no activity or password was specified, the returned Bundle contains only KEY_INTENT with the Intent needed to launch the password prompt. If an error occurred, AccountManagerFuture.getResult() throws:
        • AuthenticatorException if the authenticator failed to respond
        • OperationCanceledException if the operation was canceled for any reason, including the user canceling the password prompt
        • IOException if the authenticator experienced an I/O problem verifying the password, usually because of network trouble
      • updateCredentials

        public AccountManagerFuture<Bundle> updateCredentials(Account account,
                                                     String authTokenType,
                                                     Bundle options,
                                                     Activity activity,
                                                     AccountManagerCallback<Bundle> callback,
                                                     Handler handler)
        Asks the user to enter a new password for an account, updating the saved credentials for the account. Normally this happens automatically when the server rejects credentials during an auth token fetch, but this can be invoked directly to ensure we have the correct credentials stored.

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

        This method requires the caller to hold the permission android.Manifest.permission#MANAGE_ACCOUNTS.

        Parameters:
        account - The account to update credentials for
        authTokenType - The credentials entered must allow an auth token of this type to be created (but no actual auth token is returned); may be null
        options - Authenticator-specific options for the request; may be null or empty
        activity - The Activity context to use for launching a new authenticator-defined sub-Activity to prompt the user to enter a password; used only to call startActivity(); if null, the prompt will not be launched directly, but the necessary Intent will be returned to the caller instead
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Bundle with these fields if an activity was supplied and the account credentials were successfully updated: If no activity was specified, the returned Bundle contains only KEY_INTENT with the Intent needed to launch the password prompt. If an error occurred, AccountManagerFuture.getResult() throws:
        • AuthenticatorException if the authenticator failed to respond
        • OperationCanceledException if the operation was canceled for any reason, including the user canceling the password prompt
        • IOException if the authenticator experienced an I/O problem verifying the password, usually because of network trouble
      • editProperties

        public AccountManagerFuture<Bundle> editProperties(String accountType,
                                                  Activity activity,
                                                  AccountManagerCallback<Bundle> callback,
                                                  Handler handler)
        Offers the user an opportunity to change an authenticator's settings. These properties are for the authenticator in general, not a particular account. Not all authenticators support this method.

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

        This method requires the caller to hold the permission android.Manifest.permission#MANAGE_ACCOUNTS.

        Parameters:
        accountType - The account type associated with the authenticator to adjust
        activity - The Activity context to use for launching a new authenticator-defined sub-Activity to adjust authenticator settings; used only to call startActivity(); if null, the settings dialog will not be launched directly, but the necessary Intent will be returned to the caller instead
        callback - Callback to invoke when the request completes, null for no callback
        handler - Handler identifying the callback thread, null for the main thread
        Returns:
        An AccountManagerFuture which resolves to a Bundle which is empty if properties were edited successfully, or if no activity was specified, contains only KEY_INTENT needed to launch the authenticator's settings dialog. If an error occurred, AccountManagerFuture.getResult() throws:
        • AuthenticatorException if no authenticator was registered for this account type or the authenticator failed to respond
        • OperationCanceledException if the operation was canceled for any reason, including the user canceling the settings dialog
        • IOException if the authenticator experienced an I/O problem updating settings, usually because of network trouble
      • addOnAccountsUpdatedListener

        public void addOnAccountsUpdatedListener(OnAccountsUpdateListener listener,
                                        Handler handler,
                                        boolean updateImmediately)
        Adds an OnAccountsUpdateListener to this instance of the AccountManager. This listener will be notified whenever the list of accounts on the device changes.

        As long as this listener is present, the AccountManager instance will not be garbage-collected, and neither will the Context used to retrieve it, which may be a large Activity instance. To avoid memory leaks, you must remove this listener before then. Normally listeners are added in an Activity or Service's Activity.onCreate(android.os.Bundle) and removed in Activity.onDestroy().

        It is safe to call this method from the main thread.

        This method requires the caller to hold the permission android.Manifest.permission#GET_ACCOUNTS.

        Parameters:
        listener - The listener to send notifications to
        handler - Handler identifying the thread to use for notifications, null for the main thread
        updateImmediately - If true, the listener will be invoked (on the handler thread) right away with the current account list
        Throws:
        IllegalArgumentException - if listener is null
        IllegalStateException - if listener was already added


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 355 / . Delta: 0.04924 с