Beispiel #1
0
        public void HandleLocationServiceError(LocationErrors error)
        {
            Log.Debug(TAG, "ERROR: " + error.ToString());
            bool showToast = false;

            if (error == LocationErrors.GooglePlayServicesNotInstalled)
            {
                Log.Debug(TAG, "GooglePlay Services not installed");
                if (showToast)
                {
                    Toast.MakeText(this, "GooglePlay Services not installed", ToastLength.Short).Show();
                }
            }
            if (error == LocationErrors.MissingPermission)
            {
                Log.Debug(TAG, "MissingPermission");
                if (showToast)
                {
                    Toast.MakeText(this, "MissingPermission", ToastLength.Short).Show();
                }
            }
            if (error == LocationErrors.GooglePlayServicesFails)
            {
                Log.Debug(TAG, "GooglePlay Services fails");
                if (showToast)
                {
                    Toast.MakeText(this, "GooglePlay Services fails", ToastLength.Short).Show();
                }
            }
            if (IsAirplaneModeOn(ApplicationContext))
            {
                Log.Debug(TAG, "IsAirplaneModeOn");
                if (showToast)
                {
                    Toast.MakeText(this, "AirplaneModeOn", ToastLength.Short).Show();
                }
            }
            else
            {
                var current = Connectivity.NetworkAccess;
                if (current != NetworkAccess.Internet)
                {
                    // Connection to internet is available
                    if (showToast)
                    {
                        Toast.MakeText(this, "NoInternet", ToastLength.Short).Show();
                    }
                    Log.Debug(TAG, "NoInternet");
                }
            }
            //   ShowLocationFragment(myLocation, LocationStatus.OK);
            //    infoPanelVisible = InfoPanelVisible.False;
            //   ShowinfoPanel(InfoPanelVisible.False);
        }
 private void OnLocationServiceError(LocationErrors error)
 {
     BroadcastEvent(LocationEventType.ServiceError, LocationError, (int)error);
 }