如何获得用户的谷歌市场账户?

时间:2012-01-24 11:04:37

标签: android

如何从代码中获取用户的市场帐户,即他们在Google市场中安装应用程序的帐户?

1 个答案:

答案 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;
}