我已将Google plus与我的Android应用集成.一切正常,我也连接到谷歌加,但我无法得到当前用户的名称记录.
public void onConnected(Bundle connectionHint) {
String personName="Unknown";
if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
personName = currentPerson.getDisplayName();
}
}
Run Code Online (Sandbox Code Playgroud)
Plus.PeopleApi.getCurrentPerson(mGoogleApiClient)
此方法始终返回null.
任何帮助将不胜感激.谢谢.