问题
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
But using AccountManager
I get
which is at least Material in colour
or this from AccountPicker
(ICS!!)
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.
回答1:
You can use Google Api Client document
来源:https://stackoverflow.com/questions/42799247/android-struggling-to-style-account-picker