我試圖與谷歌加登錄和它的作品fine.I已產生密切相關與我的帳戶中有多個帳戶時,所以它告訴我彈出選擇帳戶,但是當我上的取消按鈕,然後單擊並disappears.It它出現再次&。告訴我如何做到這一點?這意味着即使用戶點擊取消按鈕,你還叫 - 谷歌加'選擇賬戶'選擇賬戶不會消失取消?
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN)
{
Log.i("RAE","Result is ");
if (resultCode != RESULT_OK) {
mSignInClicked = false;
}
mIntentInProgress = false;
if (!mGoogleApiClient.isConnecting()) {
mGoogleApiClient.connect();
}
}
}
在連接時您沒有使用的價值爲mSignInClicked
確定是否startIntentSenderForResult()
失敗
@Override
public void onConnectionFailed(ConnectionResult result) {
// TODO Auto-generated method stub
if (!mIntentInProgress && result.hasResolution()) {
try {
mIntentInProgress = true;
startIntentSenderForResult(result.getResolution().getIntentSender(),
RC_SIGN_IN, null, 0, 0, 0);
} catch (SendIntentException e) {
// The intent was canceled before it was sent. Return to the default
// state and attempt to connect to get an updated ConnectionResult.
mIntentInProgress = false;
mGoogleApiClient.connect();
}
}
}
發佈您的代碼! – ianhanniballake 2015-02-12 05:54:01
chek我更新的問題 – 2015-02-12 05:57:00
你可以發佈你的'onConnectionFailed()'以及? – ianhanniballake 2015-02-12 05:59:49