I'm trying to implement google plus sign in for an android app. I followed the guide on the google developer page "https://developers.google.com/+/mobile/android/getting-started". My only problem is that when there's only one google account on the device, the account picker dialog does not show. Is there a way around this?

I used an AccountPicker as suggested by @acj. I start an AccountPicker intent
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
new String[] { "com.google" }, true, null, null, null,
null);
startActivityForResult(intent, ACCOUNT_PICKER_REQUEST_CODE);
and when the result is returned, I initialize the GoogleApiClient, setting the accountName as stated on the developer page:
GoogleApiClient client = new GoogleApiClient.Builder(this)
.addApi(Plus.API)
.addScope(Plus.SCOPE_PLUS_LOGIN)
.setAccountName("[email protected]")
.build();
client.connect();
@dcool, hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With