Current Android Release version:
Version Code: Pie
Version: 9
API level: 28

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