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 addresses, but below 2.0 you can only have one e-mail address per device.
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 addresses, but below 2.0 you can only have one e-mail address per device.
There is an Android api that allows the user to select their email address without the need for a permission. Take a look at: https://developers.google.com/identity/smartlock-passwords/android/retrieve-hints
This will show a picker where the user can select an emailaddress. The result will be delivered in
onActivityResult()
Use this method:
Note that this requires the
GET_ACCOUNTS
permission:Then:
Working In MarshMallow Operating System