Android遊戲客戶端,Fragment上未顯示成就解鎖彈出窗口 (Android Game Client, Achievement unlock popup not shown over the Fragment)


問題描述

Android遊戲客戶端,Fragment上未顯示成就解鎖彈出窗口 (Android Game Client, Achievement unlock popup not shown over the Fragment)

我正在註冊彈出視圖如下:

GamesClient gamesClient = Games.getGamesClient(activity, googleSignInAccount);
gamesClient.setViewForPopups(getWindow().getDecorView().findViewById(android.R.id.content));

在主活動中,但是當從全屏片段對話框中解鎖成就時,沒有顯示彈出窗口,但在活動中,它顯示正確。

請幫助在片段上顯示彈出窗口。

我試圖從片段中註冊彈出視圖但沒有任何反應。


參考解法

方法 1:

Just do nothing and delete your setViewForPopups call. It is not necessary.

方法 2:

try this

<FrameLayout
    android:id="@+id/container_pop_up"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_alignParentTop="true"
    android:layout_marginTop="16dp" />

GamesClient gamesClient = Games.getGamesClient(MainActivity.this, 
 GoogleSignIn.getLastSignedInAccount(this));
        gamesClient.setViewForPopups(findViewById(R.id.container_pop_up));

        Games.getAchievementsClient(this, GoogleSignIn.getLastSignedInAccount(this))
                .unlock(getString(R.string.achievement_example));

(by jitain sharmaMrStahlfelgeUgur Gul)

參考文件

  1. Android Game Client, Achievement unlock popup not shown over the Fragment (CC BY‑SA 2.5/3.0/4.0)

#google-play-games #Android






相關問題

Google Play 服務登錄錯誤 (Google Play Services sign in error)

Google Player 遊戲服務錯誤:無法構建示例遊戲 (Google Player Game Service Error: Can't build the sample game)

Google Play 遊戲服務無法接受邀請 (Google Play Game Services can't accept invitations)

ITMS-90535 無法發布 libgdx iOS 應用程序 (ITMS-90535 Unable to publish libgdx iOS app)

Google Play 遊戲成就 - 積分不變 (Google Play Games Achievements - Points Not Changing)

玩遊戲服務,我們能知道我們什麼時候通過另一個hiscore嗎? (Play Game Services, can we know when we pass another hiscore?)

Android Google Play 遊戲服務 (Android Google Play Games Services)

為 Google 播放器帳戶存儲自定義數據的免費方式。(安卓,全球定位系統) (Free way to store custom data for a google player account. (Android, GPGS))

Unity Google Play Services Plugin API 與 Show Leaderboard UI 功能不同步? (Unity Google Play Services Plugin API is not sync with Show Leaderboard UI function?)

Android遊戲客戶端,Fragment上未顯示成就解鎖彈出窗口 (Android Game Client, Achievement unlock popup not shown over the Fragment)

我在 google play 上發布的應用程序在用戶下載時會顯示一個 android 文件。我怎樣才能解決這個問題? (My published app on google play shows an android file when users download it. How can i fix this?)

Google Drive Api 已棄用(Google play games -> Saved Games) (Google Drive Api deprecated ( Google play games -> Saved Games ))







留言討論