How do you get the Android\'s primary e-mail address (or a list of e-mail addresses)?
It\'s my understanding that on OS 2.0+ there\'s support for multiple e-mail add
Add this single line in manifest (for permission)
Then paste this code in your activity
private ArrayList getPrimaryMailId() {
ArrayList accountsList = new ArrayList();
try {
Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");
for (Account account : accounts) {
accountsList.add(account.name);
Log.e("GetPrimaryMailId ", account.name);
}
} catch (Exception e) {
Log.e("GetPrimaryMailId", " Exception : " + e);
}
return accountsList;
}