Android - struggling to style Account Picker

大城市里の小女人 提交于 2019-12-22 10:45:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!