我正在尝试在我的游戏中实现一个 AccountPicker,我已经尝试使用 newChooseAccountIntent
的所有三个版本,2 个来自 AccountManager
,一个来自 帐户选择器
。
我的代码是这样的
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);
}
或相同,但将 AccountManager
替换为 AccountPicker
我的目标是有一个看起来像这样的选择器
但是使用 AccountManager
我得到
至少是 Material 的颜色
或者来自 AccountPicker
(ICS!!)
知道我做错了什么吗?
我认为可能是 AccountManager
正在填充第一个字段,即 selectedAccount,但当我这样做时,它只是选择了相应帐户的单选按钮。
最佳答案
您可以使用 Google Api 客户端 document
关于Android - 努力设置帐户选择器的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42799247/