在我的游戏,我用GoogleApiClient.connect()
和GoogleApiClient.disconnect()
但是当我连接我不能选择我的帐户中,首先选择修复帐户。我希望能够选择我的帐户进行游戏。我执行保存的游戏代码,并且希望能够选择我的帐户时,我reconect。GoogleApiClient力完全断开
我的设备保存我的帐户的所有游戏。我可以强制我的游戏选择帐户?
我的代码:
mGoogleApiClient = new GoogleApiClient.Builder(a)
.addConnectionCallbacks(connectionCallbacks)
.addOnConnectionFailedListener(cfl)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.addScope(Drive.SCOPE_APPFOLDER)
.setViewForPopups(a.findViewById(android.R.id.content))
.build();
mGoogleApiClient.connect();
public static void desconectarGoogle(){
if(mGoogleApiClient!=null && isSignedIn())
mGoogleApiClient.disconnect();
}
clearDefaultAccount已被弃用,你的代码不工作,签出和清除默认不能解决。 –
正确的代码FOS signOut是Games.signOut(mGoogleApiClient);但不要强迫在重新选择时选择帐户。 –
好对不起,代码工作,是我的机器人工作室,somtimes不更新游戏:) –