简体   繁体   中英

Google+ integration does not show account picker for devices with single google account

I am trying to implement Google+ integration in one of my android app.But i am not seeing Account picker if there is only one account on my device.

How can i show the account picker in such case?

That's how I show it:

  scopes.add(AnalyticsScopes.ANALYTICS_READONLY);

                credential = GoogleAccountCredential.usingOAuth2(this, scopes);
                if (TextUtils.isEmpty(appPreferences.getUserName()))
                {
                        try
                        {

                                startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER);
                        }
                        catch (ActivityNotFoundException e)
                        {

                                Toast.makeText(this, getString(R.string.gps_missing), Toast.LENGTH_LONG).show();

                                return;
                        }

                }

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