我正在使用开发人员文档中的这个简单方法解锁成就:
Games.Achievements.unlock(getApiClient(), "my_achievement_id");
成就解锁,但没有弹出窗口出现。登录到已连接的 Google Play 游戏时也没有弹出窗口。
最佳答案
只需向要显示成就的布局添加一个 View ,如下所示:
<FrameLayout
android:id="@+id/gps_popup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp" />
当您准备好布局后,您需要在 Activity 或 Fragment 中执行此操作:
Games.setViewForPopups(getApiClient(), findViewById(R.id.gps_popup));
您必须确定您的 GoogleApiClient 已连接,否则您的应用会崩溃。
关于android - Google Play 游戏成就解锁弹出窗口不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26474718/