当前位置: 首页>>代码示例>>C#>>正文


C# ConnectionResult.StartResolutionForResult方法代码示例

本文整理汇总了C#中ConnectionResult.StartResolutionForResult方法的典型用法代码示例。如果您正苦于以下问题:C# ConnectionResult.StartResolutionForResult方法的具体用法?C# ConnectionResult.StartResolutionForResult怎么用?C# ConnectionResult.StartResolutionForResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConnectionResult的用法示例。


在下文中一共展示了ConnectionResult.StartResolutionForResult方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnConnectionFailed

        public void OnConnectionFailed (ConnectionResult result)
        {
            Log.Debug (TAG, "onConnectionFailed:" + result);

            if (!mIsResolving && mShouldResolve)
            {
                if (result.HasResolution)
                {
                    try
                    {
                        result.StartResolutionForResult (Activity, RC_SIGN_IN);
                        mIsResolving = true;
                    }
                    catch (IntentSender.SendIntentException e)
                    {
                        Log.Error (TAG, "Could not resolve ConnectionResult.", e);
                        mIsResolving = false;
                        mGoogleApiClient.Connect ();
                    }
                }
                else {
                    ShowErrorDialog (result);
                }
            }
            else {
                UpdateUI (false);
            }
        }
开发者ID:yonifra,项目名称:Shortie,代码行数:28,代码来源:LoginFragment.cs

示例2: OnConnectionFailed

        public void OnConnectionFailed(ConnectionResult result)
        {
            if (resolvingError)
                return; // Already attempting to resolve an error.

            if (result.HasResolution)
                try {
                    resolvingError = true;
                    result.StartResolutionForResult(context, 1001);
                } catch (Exception e) {
                    Console.WriteLine("[SimpleLocation: Connection failed. Error: {0}]", e.Message);
                    googleApiClient.Connect(); // There was an error with the resolution intent. Try again.
                }
            else {
                GooglePlayServicesUtil.GetErrorDialog(result.ErrorCode, context, 9000)?.Show();
                resolvingError = true;
            }
        }
开发者ID:jv9,项目名称:SimpleLocation,代码行数:18,代码来源:SimpleLocationManager.Droid.cs

示例3: catch

        IObservable<bool> IConnectionResultHandler.HandleConnectionResult(ConnectionResult connectionResult)
        {
            if (!connectionResult.HasResolution)
            {
                GoogleApiAvailability
                    .Instance
                    .GetErrorDialog(this, connectionResult.ErrorCode, 0)
                    .Show();
                return Observable.Return(false);
            }

            try
            {
                this.resultResolutionSubject.Disposable = new Subject<bool>();
                connectionResult.StartResolutionForResult(this, RequestCodeResolution);
                return this.resultResolutionSubject.Disposable;
            }
            catch (IntentSender.SendIntentException)
            {
                return Observable.Return(false);
            }
        }
开发者ID:reactiveui-forks,项目名称:WorkoutWotch,代码行数:22,代码来源:MainActivity.cs

示例4: OnConnectionFailed

        public void OnConnectionFailed(ConnectionResult result)
        {
            Log.Error(TAG, "Connect to Google API failed: {0}.", result.ErrorCode);
            if (_authInProgress)
            {
                return;
            }
            if (!result.HasResolution)
            {
                return;
            }

            try
            {
                _authInProgress = true;
                result.StartResolutionForResult(this, GOOGLE_PLAY_SERVICES_REQUEST_AUTHORIZATION);
            }
            catch (IntentSender.SendIntentException e)
            {
                _authInProgress = false;
                Log.Error(TAG, "Could not resolve Google Play Services error: {0}", e.LocalizedMessage);
            }
        }
开发者ID:ChristopheDaVinci,项目名称:gplus-quickstart-xamarin.android,代码行数:23,代码来源:AccountPickerExample.cs

示例5: OnConnectionFailed

		public void OnConnectionFailed (ConnectionResult result)
		{
			if (resolving)
				return;

			if (result.HasResolution) {
				resolving = true;
				result.StartResolutionForResult (activity, RC_RESOLVE);
				return;
			}

			resolving = false;
			SignedOut = false;
			signingin = false;
			if (OnSignInFailed != null)
				OnSignInFailed (this, EventArgs.Empty);
		}
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:17,代码来源:GameHelper.cs

示例6: OnConnectionFailed

        public void OnConnectionFailed (ConnectionResult result) 
        {
            if (mResolvingError)
                return;

            mPersonListView.Adapter = null;
            try {
                result.StartResolutionForResult (this, REQUEST_CODE_SIGN_IN);
                mResolvingError = true;
            } catch (Android.Content.IntentSender.SendIntentException) {
                // Get another pending intent to run.
                mGoogleApiClient.Connect ();
            }
        }
开发者ID:ravensorb,项目名称:AdMobBuddy,代码行数:14,代码来源:ListVisiblePeopleActivity.cs

示例7: OnConnectionFailed

        /// <summary>
        /// Called when [connection failed].
        /// </summary>
        /// <param name="result">The result.</param>
        public void OnConnectionFailed(ConnectionResult result)
        {
            if (this.resolving)
            {
                return;
            }

            if (result.HasResolution)
            {
                this.resolving = true;
                result.StartResolutionForResult(this.activity, RC_RESOLVE);
                this.adapter.OnActivityResult += this.OnConnectionFailedActivityResult;
                return;
            }

            this.resolving = false;
            this.SignedOut = false;
            this.signingin = false;

            if (this.OnSignInFailed != null)
            {
                this.OnSignInFailed(this, EventArgs.Empty);
            }
        }
开发者ID:WaveEngine,项目名称:Extensions,代码行数:28,代码来源:GooglePlayGameHelper.cs

示例8: ResolveLogin

 /// <summary>
 /// After we fail to connect to Google Play, it will tell us why. In some cases the
 /// failure reason can be automatically resolved (eg. Login Required).
 /// </summary>
 /// <param name="result">The reason we failed to connect.</param>
 private void ResolveLogin(ConnectionResult result)
 {
     // Does this failure reason have a solution?
     if (result.HasResolution) 
     {
         try 
         {
             // Try to resolve the problem automatically.
             result.StartResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR);
         } 
         catch (Android.Content.IntentSender.SendIntentException /*e*/) 
         {
             // Not really sure why this is here.
             pGooglePlayClient.Connect();
         }
     }
 }
开发者ID:vigomes03,项目名称:mbhswipetapsmash,代码行数:22,代码来源:Activity1.cs

示例9: OnConnectionFailed

		public void OnConnectionFailed (ConnectionResult result)
		{
			if (Log.IsLoggable(Constants.TAG, LogPriority.Debug)) {
				Log.Debug (Constants.TAG, "Disconnected from Google Api Service");
			}
			if (WearableClass.NodeApi != null) {
				WearableClass.NodeApi.RemoveListener (mGoogleApiClient, this);
			}
			if (mResolvingError) {
				// Already attempting to resolve the error
				return;
			} else if (result.HasResolution) {
				try {
					mResolvingError = true;
					result.StartResolutionForResult (this, REQUEST_RESOLVE_ERROR);
				} catch {
					// There was an error with the resolution intent. Try again
					mGoogleApiClient.Connect ();
				}
			} else {
				mResolvingError = false;
			}
		}
开发者ID:supersume,项目名称:monodroid-samples,代码行数:23,代码来源:MainActivity.cs

示例10: ResolveLogin

 /// <summary>
 /// Checks to see if we have a resolution
 /// </summary>
 /// <param name="result">Result.</param>
 private void ResolveLogin(ConnectionResult result)
 {
     if (result.HasResolution) {
         try {
             result.StartResolutionForResult (this, REQUEST_CODE_RESOLVE_ERR);
         } catch (Android.Content.IntentSender.SendIntentException e) {
             plusClient.Connect ();
         }
     } else if(progressDialog != null && progressDialog.IsShowing) {
         progressDialog.Dismiss ();
     }
 }
开发者ID:Mpverdi,项目名称:GooglePlusSignIn,代码行数:16,代码来源:MainActivity.cs

示例11: OnConnectionFailed

        public void OnConnectionFailed(ConnectionResult result)
        {
            _connectStopwatch.Stop();
            Logger.Warn($"{_activity.GetType()} Google Play Services connection failed after {_connectStopwatch.ElapsedMilliseconds}ms: {result}");

            if(IsResolvingError) {
                return;
            }

            if(!result.HasResolution) {
                Logger.Debug($"{_activity.GetType()} Google Play Services connection failure has no resolution, showing error dialog...");
// TODO: if the error here is service missing, bad things happen (as per the emulator behavior)
                IsResolvingError = true;
                GoogleApiAvailability.Instance.GetErrorDialog(_activity, result.ErrorCode, 0).Show();
                IsResolvingError = false;

                OnConnected(new PlayServicesConnectedEventArgs { IsSuccess = false });
                return;
            }

            try {
                IsResolvingError = true;

                Logger.Debug($"{_activity.GetType()} Starting Google Play Services connection failure resolution activity...");
                result.StartResolutionForResult(_activity, RequestCodeResolveError);
            } catch(IntentSender.SendIntentException) {
                Logger.Error($"{_activity.GetType()} Exception while starting resolution activity, retrying connection...");
                ConnectAsync().Wait();
            }
        }
开发者ID:Luminoth,项目名称:BackpackPlanner,代码行数:30,代码来源:DroidPlayServicesManager.cs


注:本文中的ConnectionResult.StartResolutionForResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。