[英]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). 请建议我如何将多个Google帐户添加到我的应用程序中,以便用户可以在帐户之间进行切换,并且应用程序UI数据将根据所选帐户而变化(就像在android Gmail应用程序中一样)。
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. 用户可以将多个Google帐户添加到android环境中,然后他/她可以在您的应用中在它们之间进行切换。
EDIT: I think you shouldn't think about multiple accounts, you just implement 编辑:我认为您不应该考虑多个帐户,您只需实施
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 转到设置->帐户->添加帐户-> Google
Then follow the instructions and add other extra google accounts to switch in any apps in android 然后按照说明进行操作,并添加其他额外的Google帐户以在android中切换任何应用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.