0
public void onConnected(Bundle connectionHint) {

      String personName="Unknown";
    if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
       Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
       personName = currentPerson.getDisplayName();
       .........
    }
}

I've tried all possibility

Plus.PeopleApi.loadVisible(mGoogleApiClient, null).setResultCallback(this);

I doubly checked SHA keys and google-service-key generation.

but it returns Null.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Ram
  • 11
  • 2

1 Answers1

0

Try like this it will Work

private void getProfileInformation() {
        try {
            if (Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
                Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
                String personName = currentPerson.getDisplayName();
                String personPhotoUrl = currentPerson.getImage().getUrl();
                String email = Plus.AccountApi.getAccountName(mGoogleApiClient);

                username.setText(personName);
                emailLabel.setText(email);

                new LoadProfileImage(image).execute(personPhotoUrl);

                // update profile frame with new info about Google Account
                // profile
                updateProfile(true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

link for reference

refer above link login , logout, Profile info Working fine.

Community
  • 1
  • 1
Android Dev
  • 421
  • 8
  • 26