Code example for AccountManager

Methods: getAccountsByType

0
    /* 
     * login handling 
     */ 
 
	private Account[] getAccounts() {
		return accountManager.getAccountsByType(MANAGED_ACCOUNT_TYPE);
	} 
 
    private Account getAccount() {
        final String accountName = getSettings().getAccountName();
 
        if (accountName != null) {
            final Account[] accounts = getAccounts();
 
            /* 
             * check whether account does still exist 
             */ 
            for (Account account : accounts) {
                if (accountName.equals(account.name)) {
                    return account;
                }