Harinder
Harinder

Reputation: 11944

Fetch email of configured account in android phone?

I want to fetch the emails of the account configured on my phone.

How can I do that? Are the emails stored in a database or they are fetched at runtime?

Upvotes: 1

Views: 1243

Answers (1)

IncrediApp
IncrediApp

Reputation: 10363

You need to use the GET_ACCOUNTS permission and then run this code:

Account[] accounts = AccountManager.get(this).getAccounts();
for (Account account : accounts) {
   // Check here for the type and name to find the email records.
}

Upvotes: 4

Related Questions