android – Google Play游戏 – 自动调用beginUserInitiatedSignIn()的Activity

前端之家收集整理的这篇文章主要介绍了android – Google Play游戏 – 自动调用beginUserInitiatedSignIn()的Activity前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我最近在我的应用中更新了Google Play服务库,以使用新的Google API.这样,每当我第一次启动一个Activity(它扩展BaseGameActivity)而没有登录时,Activity会自动出现登录对话框.

我没有在任何地方进行任何beginUserInitiatedSignIn()调用.这很烦人 – 这有什么办法吗?

这是一个logcat:

03-02 21:13:08.067: W/PopupManager(12332): 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.
03-02 21:13:08.137: D/dalvikvm(12332): GC_FOR_ALLOC freed 223K,3% free 9306K/9560K,paused 16ms,total 16ms
03-02 21:13:08.197: I/Adreno-EGL(12332): 404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13
03-02 21:13:08.228: D/OpenGLRenderer(12332): Enabling debug mode 0
03-02 21:13:39.771: W/PopupManager(12432): 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.
03-02 21:13:39.891: D/dalvikvm(12432): GC_FOR_ALLOC freed 227K,3% free 9303K/9560K,paused 17ms,total 17ms
最佳答案
这是默认行为,根据this issue.

FAQ指出:

[4] Why is GameHelper/BaseGameActivity attempting to sign in on
application startup?

The default behavior of BaseGameActivity and GameHelper is to show the user
the sign-in flow (consent dialogs,etc) as soon as your application starts.
Naturally,once the user signs in for the first time,they won’t see the
consent flow again,so it will be a seamless experience. It is important
for the user to sign in as early as possible so your application can take
advantage of the Google Play Games API right away (for example,saving the
user’s progress using Cloud Save,unlocking achievements,etc). If the user
cancels the sign-in flow,BaseGameAcitivity/GameHelper will remember that
cancellation. If the total number of cancellations reaches a predefined
maximum (by default,3),the user will no longer be prompted to sign in on
application startup. If that happens,they can still sign in by clicking
your application’s Sign In button,if you provide one.

[5] I don’t like the new “auto sign in” feature of GameHelper. How can
I disable it?

To disable this feature and return to the old behavior,you can edit
GameHelper.java and set the DEFAULT_MAX_SIGN_IN_ATTEMPTS constant to 0,or
call GameHelper.setMaxAutoSignInAttempts(0) at runtime,before calling
GameHelper.setup() (or,correspondingly,from your Activity’s onCreate
method).

猜你在找的Android相关文章