【发布时间】:2018-06-17 05:36:11
【问题描述】:
我一直在尝试在我的 LibGDX 项目中添加 setPopUpView(),但它没有显示。这是我的代码。
private void signInSilently() {
mGoogleSignInClient.silentSignIn().addOnCompleteListener(this,
new OnCompleteListener<GoogleSignInAccount>() {
@Override
public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
if (task.isSuccessful()) {
GoogleSignInAccount signedInAccount = task.getResult();
GamesClient gamesClient = Games.getGamesClient(AndroidLauncher.this, signedInAccount);
View view = new View(AndroidLauncher.this);
gamesClient.setGravityForPopups(Gravity.TOP);
gamesClient.setViewForPopups(view);
onConnected(task.getResult());
Log.d(TAG, "signInSilently(): success");
} else {
onDisconnected();
Log.d(TAG, "signInSilently(): failure", task.getException());
}
}
});
}
【问题讨论】:
标签: android libgdx google-play-services google-play-games