Code example for AccountManagerFuture

Methods: getResult

0
 
            final Account[] accounts = AccountManager.get(context).getAccountsByType(Constants.Auth.BOOTSTRAP_ACCOUNT_TYPE);
            if(accounts.length > 0) {
                AccountManagerFuture<Boolean> removeAccountFuture = AccountManager.get(context).removeAccount
                        (accounts[0], null, null);
                if(removeAccountFuture.getResult() == true) {
                    return true; 
                } else { 
                    return false; 
                } 
            } 
 
            return false; 
        } 
 
        @Override 
        protected void onSuccess(Boolean accountWasRemoved) throws Exception {
            super.onSuccess(accountWasRemoved);
 
            Ln.d("Logout succeeded: %s", accountWasRemoved);
            onSuccess.run();