Tech tip of this week

How to get List of Accounts configured in device

private ArrayList<AccountInfo> mAccountList = null;

Account[] mAccount = AccountManager.get(this).getAccounts();
for (Account account : mAccount) {
    AccountInfo list = new AccountInfo(account.name, account.type);
    mAccountList.add(list);
}

No comments:

Post a Comment