title: Google Play Games Services crashes briefly after loadPlayerCenteredScores
body: <p>I'm writing a game in android using Google Play Games Services. I want to get other players using GamesClient.<a href="http://developer.android.com/reference/com/google/android/gms/games/GamesClient.html#loadPlayerCenteredScores%28com.google.android.gms.games.leaderboard.OnLeaderboardScoresLoadedListener,%20java.lang.String,%20int,%20int,%20int,%20boolean%29" rel="nofollow">loadPlayerCenteredScores</a>. The problem has to do with getting the profile image. I use <a href="http://developer.android.com/reference/com/google/android/gms/games/leaderboard/LeaderboardScore.html#getScoreHolderIconImageUri%28%29" rel="nofollow">getScoreHolderIconImageUri()</a> and fetch the URI with <a href="http://developer.android.com/reference/com/google/android/gms/common/images/ImageManager.html#loadImage%28com.google.android.gms.common.images.ImageManager.OnImageLoadedListener,%20android.net.Uri,%20int%29" rel="nofollow">ImageManager.loadImage</a>. My image loaded listener never gets called and games services stops working like a second after the call, the game continues normally (As if games services was disconnected) and  I don't get any error in the log whatsoever except for a warning.
   Here is the code: </p>
  
  <pre><code>public void PlayersLoader(){
      getMainActivity().getGamesClient().loadPlayerCenteredScores(
              new OnLeaderboardScoresLoadedListener(){
                  @Override
                  public void onLeaderboardScoresLoaded(int statusCode, LeaderboardBuffer leaderboard, LeaderboardScoreBuffer scores){
                      if(statusCode==0){
                          LeaderboardScore score;
                          String playerId=getMainActivity().getGamesClient().getCurrentPlayer().getPlayerId();
                          ImageManager imMan=ImageManager.create(getContext());
                          for(int i=0;i&lt;scores.getCount();i++){
                              score=scores.get(i);
                              String name;
                              if(score.getScoreHolder().getPlayerId().equals(playerId)){
                                  name=getResources().getString(R.string.your_best);
                              }
                              else{
                                  name=score.getScoreHolderDisplayName();
                              }
                              Uri imuri=score.getScoreHolderIconImageUri();
                              if(imuri!=null){
                                  imMan.loadImage(new ImageLoaded(name),imuri);
                              }
                          }
                          System.out.println("Finish");
                          scores.close();
                          leaderboard.close();
                      }
                  }
              },getResources().getString(R.string.HighScores),LeaderboardVariant.TIME_SPAN_ALL_TIME,
              LeaderboardVariant.COLLECTION_SOCIAL,10);
  }
  
  }
  class ImageLoaded implements OnImageLoadedListener{
  String mName;
  public ImageLoaded(String name){
      mName=new String(name);
  
      System.out.println(mName);
              //This does get printed out (the names of the players)
  }
  @Override
  public void onImageLoaded(Uri uri, Drawable drawable){
  
      System.out.println("imageLoaded"); //This never gets printed out
  
  }
  }
  </code></pre>
  
  <p>This is what I get in the log:</p>
  
  <pre><code>//Your Best
  //Player 1 Name
  //Player 2 Name
  //Finished
  //Games Services has stopped working dialog in phone, when I click OK, this warning shows:
  //*** Unexpectedly disconnected. Severing remaining connections.
  </code></pre>
  
  <p>If I remove the ImageManager call and print out the names only, they get printed out correctly and nothing stops working.</p>
  
  <p>I don't know what's happening, I'm desperate.</p>
  
  <p>EDIT
  Even if I comment this line:</p>
  
  <p><code>imMan.loadImage(new ImageLoaded(name),imuri);</code></p>
  
  <p>the error happens.
  It is only when I remove this that it stops happening:</p>
  
  <p><code>Uri imuri=score.getScoreHolderIconImageUri();</code> 
  It's so strange! Even if I do not do anything with <code>imuri</code>. </p>
  
  <p>EDIT I posted the issue <a href="https://code.google.com/p/play-games-platform/issues/detail?id=7" rel="nofollow">here</a>. It seems it was a bug of Google Play Services. Sure they will fix it soon!</p>