Thursday, 21 July 2011

Retrive Configured Email Accounts

You can retrieve the email accounts configured on the device's native email client.

public Vector fetchConfiguredEmail(Context context){
        AccountManager accManager = AccountManager.get(context);
        Account acc[] = accManager.getAccounts();
        int accCount = acc.length;
        Vector accounts = new Vector();
        for(int i = 0; i < accCount; i++){
        return accounts;

Permission: You need to add this permission to your manifest file:
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>

No comments:

Post a Comment