3

I'm working with Google play game services and I'm using this code to get player detail.

if (gamesClient != null) {
        Games.Leaderboards.loadCurrentPlayerLeaderboardScore(gamesClient, 
                activity.getString(R.string.leaderboard_high_score), 
                LeaderboardVariant.TIME_SPAN_ALL_TIME, 
                LeaderboardVariant.COLLECTION_SOCIAL).setResultCallback(new ResultCallback<Leaderboards.LoadPlayerScoreResult>() {

            @Override
            public void onResult(Leaderboards.LoadPlayerScoreResult result) {
                // TODO Auto-generated method stub
                LeaderboardScore lbs = result.getScore();
                int score = (int) lbs.getRawScore();
                String name = lbs.getScoreHolderDisplayName();
                Uri urlimage = lbs.getScoreHolderHiResImageUri();
                Uri urlicon = lbs.getScoreHolderIconImageUri();
                Log.e("tag", "name: "+name+"\nscore: "+score+"\nurlimage: "+urlimage+"\nurlicon: "+urlicon);
            }
        });
} else {
            //Login
}

but here I'm getting profile image link like "content://com.google.android.gms.games.background/images/33407107/22" with this how can I show profile image in my application using image view please help me. thank you..

Suresh
  • 427
  • 1
  • 6
  • 22
  • possible duplicate of [How to load an ImageView by URL in Android?](http://stackoverflow.com/questions/2471935/how-to-load-an-imageview-by-url-in-android) – Bö macht Blau Sep 25 '15 at 05:45
  • This kind of process is not getting the image.. – Suresh Sep 30 '15 at 07:15
  • ok, I think did not understand your problem. Sorry. But maybe [this SO question](http://stackoverflow.com/questions/32775503) will help you. They have exactly the same image link (see comment below first answer) – Bö macht Blau Sep 30 '15 at 07:43
  • ImageManager is the way to load the image but i tried, it didn't worked for me. https://developers.google.com/android/reference/com/google/android/gms/common/images/ImageManager.html – Avinesh Jan 13 '17 at 17:28

1 Answers1

4

I try it using ImageManager like this one:

    Uri icon = Games.Players.getCurrentPlayer(googleApiClient).getIconImageUri();

    ImageManager manager = ImageManager.create(this);
    manager.loadImage(photo, icon);

I haven't tried it yet on LeaderboardScore, but I think it will be same. since the Uri format is same content://com.google.android.gms.games.background/blablabla

Hayi Nukman
  • 1,191
  • 12
  • 29