大佬教程收集整理的这篇文章主要介绍了android – Google Plus登录“选择帐户”对话框出现两次,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
此外,从“选择一个帐户”中选择一个帐户会显示权限,如果我在此时点击取消并从拨号盘中选择另一个帐户,则会显示错误的权限图片或有时根本没有图片.我也得到了一次内部错误.
@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); } 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(); } } }
private void resolveSignInError() { if (mConnectionResult.hasResolution()) { try { mIntenTinProgress = true; mConnectionResult.startResolutionForResult(this,RC_SIGN_IN); } catch (SendIntentexception E) { mIntenTinProgress = false; mGoogleApiClient.connect(); } } } @Override public void onConnectionFailed(ConnectionResult result) { if (!result.hasResolution()) { GooglePlayservicesUtil.getErrorDialog(result.getErrorCode(),this,0).show(); return; } if (!mIntenTinProgress) { mConnectionResult = result; if (mSignInClicked) { resolveSignInError(); } } } @Override protected void onActivityResult(int requestCode,int responseCode,Intent intent) { if (requestCode == RC_SIGN_IN) { if (responseCode != RESULT_OK) { mSignInClicked = false; } mIntenTinProgress = false; if (!mGoogleApiClient.isConnecTing()) { mGoogleApiClient.connect(); } } }
以上是大佬教程为你收集整理的android – Google Plus登录“选择帐户”对话框出现两次全部内容,希望文章能够帮你解决android – Google Plus登录“选择帐户”对话框出现两次所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。