android-basic-samples
android-basic-samples copied to clipboard
Games.getPlayersClient().getCurrentPlayer task never completes/running
I can successfully authenticate my user with google play games signin and get a valid GoogleSignInAccount but now i m trying to get the IconImage of currently signined in player using the code below
if(pC != null) {
pC.getCurrentPlayer().addOnCompleteListener(this, new OnCompleteListener<Player>() {
@Override
public void onComplete(@NonNull Task<Player> task) {
if(task.isSuccessful()){
Log.d("SomeTag", "onComplete: " + task.getResult().getIconImageUri().toString());
}else {
Log.d("SomeTag", "onComplete: " + task.getException().getMessage());
}
}
});
}
but this getCurrentPlayer() task never printing anything in my logcat no error, nothing, i've also tried OnFailureListener and OnSuccessListner but same problem, i m searching for the cause for like 3 days now but failed. Pls help ASAP
We see this behaviour too on some devices. Any reason for this?