0
私はXamarinを初めて使用しています。Xamarin。どのようにループ内にダイアログを表示するのですか?
これはうまくいきますが、gpsが無効のときにこのダイアログを表示する必要があります。 これをどうすれば実現できますか? 私のアプローチは、(それが何を示していない):
private void EnableGps()
{
LocationManager locationManager = null;
while (true)
{
locationManager = (LocationManager)GetSystemService(Context.LocationService);
if (locationManager.IsProviderEnabled(LocationManager.GpsProvider))
{
return;//gps is enabled
}
else
{
//show dialog
EnableGpsDialog gpsDialog = new EnableGpsDialog();
var transaction = FragmentManager.BeginTransaction();
gpsDialog.Show(transaction, "Enable GPS dialog fragment");
}
}
}