Accessing Google Account Id /username via Android

后端 未结 7 2187
夕颜
夕颜 2020-11-28 02:11

How do you access the user\'s Google Account Id / username in code? I am building an application that will call a web service to store data and I want to identify the ident

相关标签:
7条回答
  • 2020-11-28 02:47

    Used these lines:

    AccountManager manager = AccountManager.get(this);
    Account[] accounts = manager.getAccountsByType("com.google");
    

    the length of array accounts is always 0.

    0 讨论(0)
提交回复
热议问题