Code example for AccountManagerFuture

Methods: getResult

0
            authResultFuture = GetTokenICS.INSTANCE.get(am, account, authTokenType);
        } 
 
        final Bundle authResult;
        try { 
            authResult = authResultFuture.getResult();
        } catch (OperationCanceledException e) {
            throw new HttpClientException("Authentication failed: canceled by user", e);
        } catch (AuthenticatorException e) {
            throw new HttpClientException("Authentication failed", e);
        } catch (IOException e) {
            throw new HttpClientException("Authentication failed: network error", e);
        } 
        if (authResult == null) {
            throw new HttpClientException("Authentication failed"); 
        } 
 
        final String authToken = authResult.getString(AccountManager.KEY_AUTHTOKEN);
        if (authToken == null) {
            // No authentication token found: 
            // the user must allow this application to use his account.