Skip to content

Instantly share code, notes, and snippets.

@espritm
Created April 5, 2017 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save espritm/f08946dcb15a5646d756f42141d63e86 to your computer and use it in GitHub Desktop.
Save espritm/f08946dcb15a5646d756f42141d63e86 to your computer and use it in GitHub Desktop.
public class MainActivity : AppCompatActivity, IOnMapReadyCallback
{
private GoogleMap m_map;
private MapView m_mapView;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SupportActionBar.Hide();
// Set our view from the "MainActivity" layout resource
SetContentView(Resource.Layout.MainActivity);
m_mapView = FindViewById<MapView>(Resource.Id.mainactivity_mapView);
m_mapView.OnCreate(bundle);
m_mapView.GetMapAsync(this);
}
public void OnMapReady(GoogleMap map)
{
m_map = map;
}
protected override void OnPause()
{
base.OnPause();
m_mapView.OnPause();
}
protected override void OnResume()
{
base.OnResume();
m_mapView.OnResume();
}
protected override void OnSaveInstanceState(Bundle outState)
{
base.OnSaveInstanceState(outState);
m_mapView.OnSaveInstanceState(outState);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment