I’m trying to display a profile picture of users registered in my application via Google+, but I don’t know how to do it. To get the image (and other information), google provides the code
@Override
public void onConnected() {
...
if (mPlusClient.getCurrentPerson() != null) {
Person currentPerson = mPlusClient.getCurrentPerson();
String personName = currentPerson.getDisplayName();
String personPhoto = currentPerson.getImage();
String personGooglePlusProfile = currentPerson.getUrl();
}
}
I know that usually I need to get any image that I want to display from res/drawable..., but I don’t know what to do with the value personPhoto(which somehow changes from type Stringto Imagewhen you paste the code in Eclipse.
source
share