개발자 문서를 통해 Google+ 로그인을 구현 중입니다. RESOLUTION_REQUIRED
(오류 코드 6)으로 로그인하기 위해 계정을 선택하면 내 onConnectionFailed
메쏘드가 호출됩니다. 그러면 다른 계정 'Choose an Account'대화 상자가 열리고 동일한 계정을 선택하면 작동합니다 (권한으로 이동). 왜 다른 대화 상자를 불러올 지 모르겠습니다. 내가 처음으로 resolveSignInError
어떤 통찰력?Google Plus 로그인 '계정 선택'대화 상자가 두 번 나타납니다.
또한 '계정 선택'에서 계정을 선택하면 사용 권한이 표시됩니다. 그 시점에서 취소를 누르고 다이얼에서 다른 계정을 선택하면 사용 권한에 대해 잘못된 그림이 표시되거나 전혀 그림이 표시되지 않습니다. 나는 또한 An internal error has occurred
건배를 한 번 받았다.
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (!mIntentInProgress) {
// Store the ConnectionResult so that we can use it later when the user clicks
// 'sign-in'.
mConnectionResult = connectionResult;
if (mSignInClicked) {
// The user has already clicked 'sign-in' so we attempt to resolve all
// errors until the user is signed in, or they cancel.
resolveSignInError();
}
}
}
private void resolveSignInError() {
if (mConnectionResult != null && mConnectionResult.hasResolution()) {
try {
mIntentInProgress = true;
startIntentSenderForResult(mConnectionResult.getResolution().getIntentSender(),
RC_SIGN_IN, null, 0, 0, 0);
} catch (IntentSender.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();
}
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
if (resultCode != RESULT_OK) {
mSignInClicked = false;
}
mIntentInProgress = false;
if (!mGoogleApiClient.isConnecting()) {
mGoogleApiClient.connect();
}
}
}
감사합니다. 나는 super.onActivityForResult()를 가지고 그것을 제거했다. (내가 직접 결과를 처리하지 않을 때에 만 그것을 호출한다.) 문제가 해결되었다. – Ridcully