In Xamarin, I am modifying a class that was a standard Activity
but is now a Map Fragment
. The inherited Map Fragment
is of type Android.Support.V4.App.Fragment
.
Here is the previous code:
protected override void OnPause()
{
base.OnPause();
// Pause the GPS - we won't have to worry about showing the
// location.
_map.MyLocationEnabled = false;
_map.InfoWindowClick -= HandleInfoWindowClick;
_map.MarkerClick -= HandleMarkerClick;
//_map.MarkerClick -= MapOnMarkerClick;
}
protected override void OnResume()
{
base.OnResume();
SetupMapIfNeeded();
_map.MyLocationEnabled = true;
_map.InfoWindowClick += HandleInfoWindowClick;
_map.MarkerClick += HandleMarkerClick;
// Setup a handler for when the user clicks on a marker.
//_map.MarkerClick += MapOnMarkerClick;
}
This is the code I am working with:
protected override void Android.Support.V4.App.Fragment.OnPause()
{
base.OnPause();
// Pause the GPS - we won't have to worry about showing the
// location.
_map.MyLocationEnabled = false;
_map.InfoWindowClick -= HandleInfoWindowClick;
_map.MarkerClick -= HandleMarkerClick;
//_map.MarkerClick -= MapOnMarkerClick;
}
protected override void Android.Support.V4.App.Fragment.OnResume()
{
base.OnResume();
SetupMapIfNeeded();
_map.MyLocationEnabled = true;
_map.InfoWindowClick += HandleInfoWindowClick;
_map.MarkerClick += HandleMarkerClick;
// Setup a handler for when the user clicks on a marker.
//_map.MarkerClick += MapOnMarkerClick;
}
I am getting errors for both of the methods. This is the error:
Error CS0106: The modifier 'override' is not valid for this item
Can I have some help coding these functions?
Thanks in advance