问题描述
我当前的Android游戏使用BaseGameActivity.
My current Android game employs BaseGameActivity.
我的游戏使用成就,当需要时会解锁.
My game employs Achievements, which are getting unlocked when required.
但是,我始终看不到与解锁事件相关的弹出窗口.
However, I do not ALWAYS see the PopUps related to the unlock event.
我知道仅当您首次解锁成就时才会显示弹出窗口.
I know the popup only appears when you first unlock the Achievement.
某些弹出窗口看起来不错,而其他弹出窗口(来自游戏中不同屏幕的弹出窗口)则永远不会出现.
Some popups appear fine, others (from different screens within my game) never appear.
我该怎么做才能确保弹出窗口出现?
What do I have to do to Guarantee the popups appear?
我感觉与此警告有关:
W/PopupManager(10725): You have not specified a View to use as content view for popups.
Falling back to the Activity content view which may not work properly in future versions
of the API.
Use setViewForPopups() to set your content view.
我从弹出窗口未显示的活动中呼叫了setViewForPopups()
,但是我从未见过.
I have called setViewForPopups()
from within the activity my popups do not display in, however, I have never seen them.
如何调用setViewForPopups()
,以便整个应用程序都看不到上面显示的警告消息?
How do you call setViewForPopups()
so that your entire application never sees the WARNING messages shown above?
推荐答案
我通过使用以下代码找到了解决方案
I have found a solution, by using the following code
Games.setViewForPopups(getApiClient(), getWindow().getDecorView().findViewById(android.R.id.content));
我可以显示弹出窗口.我现在有一个相关的问题.弹出窗口不会显示很长时间.
I can get popups to show. I now have a related issue. The popup doesn't display for very long.
我认为这是由于我在此活动中添加了自定义动画.
I think this is due to the fact I have a custom animation into this activity.
有什么方法可以增加弹出窗口可见的时间吗?
Is there any way to increase how long a popup is visible?
这篇关于调用Games.Achievements.unlock时不显示弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!