Code example for AccountManager

Methods: getAuthToken

0
        } 
        return null; 
    } 
 
    private void onAccountSelected(final Account account) {
        accountManager.getAuthToken(account, AUTH_TOKEN_TYPE, null, this, new AccountManagerCallback<Bundle>() {
            public void run(AccountManagerFuture<Bundle> future) {
                try { 
                    String token = future.getResult().getString(AccountManager.KEY_AUTHTOKEN);
                    useToken(account, token);
                } catch (OperationCanceledException e) {
                    onAccessDenied(); 
                } catch (Exception e) {
                    handleException(e);
                } 
            } 
        }, null); 
    } 
 
    // should really use setResult + finish for all callbacks, but SmsSync is singleInstance (for some reason) 
    private void onAccessDenied() {