Code example for AccountManagerFuture

Methods: getResult

0
    private class OnTokenAcquired implements AccountManagerCallback<Bundle> {
        @Override 
        public void run(AccountManagerFuture<Bundle> result) {
            try { 
                // Get the result of the operation from the AccountManagerFuture. 
                Bundle bundle = result.getResult();
 
                // The token is a named value in the bundle. The name of the value 
                // is stored in the constant AccountManager.KEY_AUTHTOKEN. 
                String token = bundle.getString(AccountManager.KEY_AUTHTOKEN);
 
                onAuthenticated(token);
 
                Intent launch = (Intent) bundle.get(AccountManager.KEY_INTENT);
                if (launch != null) {
                    startActivityForResult(launch, 0);
                    return; 
                } 
            } catch (OperationCanceledException e) {
                throw new RuntimeException(e);
            } catch (IOException e) {