【发布时间】:2012-03-23 23:41:26
【问题描述】:
This question 一般针对安卓设备讨论它,但是如果您尝试在 Kindle Fire 上运行此代码,您得到的只是用户名。有什么方法可以获取邮箱地址吗?我们希望弹出一个对话框,其中包含已预先填写的电子邮件地址,这样如果正确,他们就不必输入,但似乎唯一的解决方案是让他们重新输入。
编辑:这是其他线程建议的代码(不适用于 Kindle Fire):
Account[] accounts = AccountManager.get(this).getAccounts();
for (Account account : accounts) {
// TODO: Check possibleEmail against an email regex or treat
// account.name as an email address only for certain account.type values.
String possibleEmail = account.name;
// possibleEmail is a list of account names, hopefully including the @gmail.com address.
}
【问题讨论】:
-
您还没有找到解决方案,是吗?我自己也遇到了这个问题
-
废话,我害怕...我的应用程序被 Kindle 上的用户侧载,仅适用于普通 Android 并遇到了这个问题...我想唯一的解决方案是我如果电子邮件不可用,则允许通过电子邮件以外的其他方式识别用户...
标签: android kindle-fire