简体   繁体   中英

How to add multiple google accounts to an android app so that user can switch between accounts

Please suggest me how can I add multiple google accounts to my app so that user can switch between accounts and app UI data will change according to the chosen account(just like in android Gmail app).

How auth token will be handled for each account?

I have implemented log in using the single account.

User can add multiple google accounts to the android environment, then he/she can switch between them in your app.

EDIT: I think you shouldn't think about multiple accounts, you just implement

  • login
  • logout

logic and when user changes account's you don't need to handle how many account the user has.

当您的Android设备已添加到您的Android设备中,并且您从Google帐户访问令牌时,它将要求选择要访问的帐户。

Go to settings-> Accounts->Add Account->Google

Then follow the instructions and add other extra google accounts to switch in any apps in android

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