void CheckGS()
        {
            _isGooglePlayServicesAvailable = GooglePlayServicesUtil.IsGooglePlayServicesAvailable(this);

            try
            {
                _addAlarmMenuButton.SetVisible(_isGooglePlayServicesAvailable == ConnectionResult.Success && Mode == Screens.Mode.None);
            }
            catch (Exception e)
            {
            }

            if (_isGooglePlayServicesAvailable != ConnectionResult.Success)
            {
                if (GooglePlayServicesUtil.IsUserRecoverableError(_isGooglePlayServicesAvailable))
                {
                    GooglePlayServicesUtil.ShowErrorDialogFragment(_isGooglePlayServicesAvailable, this, _googleServicesCheckRequestCode);
                }
                else
                {
                    ShowToast(Resource.String.device_not_supported);
                    Finish();
                }
            }
        }
Exemplo n.º 2
0
 public void OnConnectionFailed(ConnectionResult result)
 {
     Debug.WriteLine("Google API connection failed!");
     if (result.HasResolution)
     {
         try
         {
             Debug.WriteLine("Google API start asking");
             result.StartResolutionForResult(MainActivity.Current, RESULT_CODE);
         }
         catch (IntentSender.SendIntentException e)
         {
             // Unable to resolve, message user appropriately
         }
     }
     else
     {
         GooglePlayServicesUtil.ShowErrorDialogFragment(result.ErrorCode, MainActivity.Current, 0);
     }
 }
Exemplo n.º 3
0
        protected override void OnResume()
        {
            base.OnResume();
            if (!firstCreate)
            {
                circlesFragment.LoadData(this);
            }
            var avail = GooglePlayServicesUtil.IsGooglePlayServicesAvailable(this);

            if (avail == ConnectionResult.Success)
            {
                if (prefs.Enabled)
                {
                    SetTrackingEnabled(true);
                }
                return;
            }
            delayOnBoarding = true;
            GooglePlayServicesUtil.ShowErrorDialogFragment(avail, this, GooglePlayServiceResult, this);
        }