How do I switch accounts under the NEW Google Drive Android API

前端 未结 5 1821
深忆病人
深忆病人 2020-12-03 05:48

My authorization flow in the new Google Drive Android API is as follows:

  1. Menu: SELECT ACCOUNT
  2. connect();
  3. onConnectionFailed() result.startRe
5条回答
  •  眼角桃花
    2020-12-03 06:31

    It sounds like you are relying on the default account selection. In this setup, the user is prompted once to select an account, and this status is remembered.

    If you want to provide account switching capabilities in your app, you need to instead launch the account picker from your own app and provide the account name selected when you instantiate the GoogleApiClient.

    You could persist the last selected account name in shared preferences so you remember it until the next time the user switches accounts.

提交回复
热议问题