Android login in my app with google credentials

試著忘記壹切 提交于 2019-11-30 09:25:47

Is this what you want?

List<String> googleAccounts = new ArrayList<String>();
Account[] accounts = AccountManager.get(this).getAccounts();
for (Account account : accounts) {
  if (account.type.equals("com.google")) {
    googleAccounts.add(account.name);
  }
}

You can see a more detailed example in the code of the ChromeToPhone app open-sourced by Google: http://www.google.com/codesearch/p?hl=en#JWblrwroAxw/trunk/android/src/com/google/android/apps/chrometophone/MainActivity.java&l=311

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