I am getting email id by using android.permission.GET_ACCOUNTS
permission.
try {
Account[] accounts = AccountManager.get(this).getA
This code is working, Tested on Android 4.4.4, 5.0.1, 6.0 and 6.0.1
String possibleEmail = "";
final Account[] accounts = AccountManager.get(context).getAccounts();
//Log.e("accounts","->"+accounts.length);
for (Account account : accounts) {
if (Patterns.EMAIL_ADDRESS.matcher(account.name).matches()) {
possibleEmail = account.name;
}
}
possibleEmail
is the email of the device.