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
@H_502_11@
最佳答案
这是默认行为,根据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).

相关文章

以下为个人理解,如错请评 CE: 凭据加密 (CE) 存储空间, 实际路径/data/user_ce/ DE: 设备加密 (DE) 存...
转载来源:https://blog.csdn.net/yfbdxz/article/details/114702144 用EventLog.writeEvent打的日志(或...
事件分发机制详解 一、基础知识介绍 1、经常用的事件有:MotionEvent.ACTION_DOWN,MotionEvent.ACTION...
又是好久没有写博客了,一直都比较忙,最近终于有时间沉淀和整理一下最近学到和解决的一些问题。 最近进...
Android性能优化——之控件的优化 前面讲了图像的优化,接下来分享一下控件的性能优化,这里主要是面向...
android的开源库是用来在android上显示gif图片的。我在网上查了一下,大家说这个框架写的不错,加载大的...