如何从代码中获取用户的市场帐户,即他们在Google市场中安装应用程序的帐户?
答案 0 :(得分:2)
然而,你最好只尝试这样的谷歌帐户:
Account[] accounts = AccountManager.get(this).getAccountsByType("com.google");
for (Account account : accounts) {
// this is where the email should be in:
String email = account.name;
}