Accessing Google Account Id /username via Android

后端 未结 7 2254
夕颜
夕颜 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:31

    if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
      Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
      String userid=currentPerson.getId(); //BY THIS CODE YOU CAN GET CURRENT LOGIN USER ID
    }
    

提交回复
热议问题