简体   繁体   中英

android: get list of google accounts on device without GET_ACCOUNTS permission and AccountPicker

I'm already using Intent intent = AccountPicker.newChooseAccountIntent(...) to let the user chose which account using to login, but I'd like to get the same list of accounts without user's interaction so no GET_ACCOUNTS permission, no AccountPicker activity.

Is there a way ?

No, that's not possible. When you invoke the AccountPicker then you are calling for result another Activity. A Google's Activity that knows the accounts on the device because it has permissions or knows because is Google's property. But not you. Not without those permissions.

You launch AccountPicker and you expect to get a result from the launched Activity. But that activity won't give you that information if the user doesn't select an account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM