提示对话框“更新Google Play服务”时未调用监听器

时间:2017-01-31 15:35:29

标签: android google-play-services kotlin google-signin

我正在使用GoogleApiClient构建的enableAutoManage

GoogleApiClient.Builder(activity)
  .enableAutoManage(activity) { result ->
    if (!result.hasResolution()) {
      GoogleApiAvailability.getInstance().showErrorDialogFragment(activity, result.errorCode, 0)
    }
    else {
      try {
        result.startResolutionForResult(activity, errorResolutionRequestCode)
      } catch (e: SendIntentException) {
        Log.e(TAG, "Exception while starting resolution activity", e)
      }
    }
}
.addApi(Auth.GOOGLE_SIGN_IN_API, buildGoogleSignInOptions(googleAuthId))
.build()

我怎么知道connect()操作是否因为播放服务未更新而失败? 仅当用户关闭对话框(自动提示)时才会调用OnConnectionFailed回调,但在任何情况下我都需要回调来执行某些UI操作。有没有办法实现这个目标?

0 个答案:

没有答案