4

I'm trying to implement an AccountPicker in my game, and I've tried using all three versions of newChooseAccountIntent, 2 coming from AccountManager and one from AccountPicker.

my code looks like this

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
    intent = AccountManager.newChooseAccountIntent(null, null, new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE}, null, null, null, null);
} else {
    intent = AccountManager.newChooseAccountIntent(null, null, new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE}, false, null, null, null, null);
}

or the same, but replace AccountManager for AccountPicker

My aim is to have a picker that looks like this

ideal picker

But using AccountManager I get

AccountManager

which is at least Material in colour

or this from AccountPicker (ICS!!)

enter image description here

Any ideas what I'm doing wrong?

I thought it might be that the AccountManager is populating the first field which is selectedAccount, but when I did that, it just selected the radio button against the appropriate account.

Russ Wheeler
  • 2,590
  • 5
  • 30
  • 57

1 Answers1

-2

You can use Google Api Client document

  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Martin Evans May 24 '17 at 10:23