【发布时间】:2015-02-12 04:58:21
【问题描述】:
我正在尝试使用 google plus 登录,它工作正常。我有多个帐户与我的帐户相关联,因此它显示弹出窗口以选择帐户,但是当我单击取消按钮时,它确实消失了。它一次又一次地出现。告诉我怎么做?
@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();
}
}
}
连接失败
@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();
}
}
}
【问题讨论】:
-
查看我更新的问题
-
你也可以发布你的
onConnectionFailed()吗? -
请检查更新后的代码。 @ianhanniballake
标签: java android google-plus google-signin google-plus-signin