void FindClosestStation() { InvokeOnMainThread(() => { TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext(); notificationView.Show(true); StationGeolocationUtil.CurrentClosestStation(stations, this, scheduler, new Geolocator()); }); }
private void FindClosestStation() { if (stations != null) { Activity.RunOnUiThread(() => { TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext(); progressDialog = new ProgressDialog(Activity); progressDialog.SetMessage("Buscando estación cercana..."); progressDialog.Show(); closestStationButton.Enabled = false; progressDialog.SetCanceledOnTouchOutside(false); progressDialog.SetCancelable(false); StationGeolocationUtil.CurrentClosestStation(stations, this, scheduler, new Geolocator(Activity)); }); } }