コード例 #1
0
        public void OnConnectionFailed(Android.Gms.Common.ConnectionResult result)
        {
            if (apiClientResolvingError)
            {
                return;
            }

            if (result.HasResolution)
            {
                try {
                    apiClientResolvingError = true;
                    result.StartResolutionForResult(this, ConnectionFailureResolutionRequest);
                } catch (Android.Content.IntentSender.SendIntentException) {
                    client.Connect();
                }
            }
            else
            {
                var args = new Bundle();
                args.PutInt(DialogError, result.ErrorCode);
                var dialogFragment = new ErrorDialogFragment()
                {
                    Arguments = args
                };
                dialogFragment.Show(SupportFragmentManager, "errordialog");
            }
        }
コード例 #2
0
		bool CheckGooglePlayServices ()
		{
			var result = GooglePlayServicesUtil.IsGooglePlayServicesAvailable (this);
			if (result == ConnectionResult.Success)
				return true;
			var dialog = GooglePlayServicesUtil.GetErrorDialog (result,
			                                                    this,
			                                                    ConnectionFailureResolutionRequest);
			if (dialog != null) {
				var errorDialog = new ErrorDialogFragment { Dialog = dialog };
				errorDialog.Show (SupportFragmentManager, "Google Services Updates");
				return false;
			}

			Finish ();
			return false;
		}