I basically want to give option to user to select the email ID user wants. I don't want the contacts permission from user. Though account permission is fine with user. I tried answer at stackoverflow but it is not working for me. Is there any other way of getting it?
What I have tried:
Add this permission to manifest:
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
And then request the google accounts like this:
Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");
for (Account account : accounts) {
Log.d(TAG, "Found: " + account.name);
}