I embed Google+ through the developer documentation. My methods onConnectionFailed is called after I select an account to log in with a RESOLUTION_REQUIRED error (error code 6). This launches another "Select Account" dialog, which then works (accepts me for permissions) if I select one account. I am not sure why it brings up another dialogue. I start with resolveSignInError Any insight?
In addition, when you select an account from “Select Account”, permissions are displayed, if I click “Cancel” at this point and select another account on the dial, it displays the wrong image for permissions or sometimes there is no image at all. I also got An internal error has occurred toast once.
@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(); } } }
android google-plus
ono
source share