Search code examples
androidaccountmanagerandroid-4.4-kitkat

AcccountManager does not return configured Exchange Accounts


There are two exchange accounts configured in my Nexus 7 tablet with android-4.4(KitKat) installed. When i try to retrieve the count of exchange accounts as follow, it returns 0 count. This code works on every other OS version of Android, any clue?

AccountManager.get(context).getAccountsByType("com.android.exchange");


Solution

  • Finally found the solution, while querying for Exchange Accounts through AccountManager, use the account type "com.google.android.exchange" for KitKat and "com.android.exchange" for below KitKat version.