0

I'm trying to get the user's profile picture to put in layout of my game, is there a way to do it?

I tryied this but never been triggered!

public void onResult(Leaderboards.LoadPlayerScoreResult result) {
    // TODO Auto-generated method stub
    ImageView image = (ImageView) findViewById((R.id.IDImage));
    LeaderboardScore lbs = result.getScore();
    int score = (int) lbs.getRawScore();
    String name = lbs.getScoreHolderDisplayName();
    Uri urlimage = lbs.getScoreHolderHiResImageUri();
    Uri urlicon = lbs.getScoreHolderIconImageUri();
    ImageManager manager = ImageManager.create(this);
    manager.loadImage(image, urlicon);
}

Can i get some help please!! Thank you!!

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Nizar
  • 1,112
  • 4
  • 17
  • 29

1 Answers1

0

Those methods belong to the Player class and the way that others have done it is place the calls inside a function and call that function.

From this SO post:

public void showPlayerImage(int imgViewId) {
    ImageView image = (ImageView) findViewById(imgViewId);

    Player me = Games.Players.getCurrentPlayer(mGoogleApiClient);

    ImageManager mgr = ImageManager.create(this);
    mgr.loadImage(image, me.getIconImageUri());
}
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56