protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_map); mFragmentManager = SupportFragmentManager; mFragmentManager.AddOnBackStackChangedListener(this); mFragmentBreadCrumbs = FindViewById <FragmentBreadCrumbs>(Resource.Id.breadcrumbs); mFragmentBreadCrumbs.SetActivity(this); mMapFragment = (MapFragment)mFragmentManager.FindFragmentByTag("map"); if (mMapFragment == null) { mMapFragment = new MapFragment(); mMapFragment.Arguments = IntentToFragmentArguments(Intent); mFragmentManager.BeginTransaction() .Add(Resource.Id.fragment_container_map, mMapFragment, "map") .Commit(); } FindViewById <ImageButton>(Resource.Id.close_button).Click += (sender, e) => { ClearBackStack(SupportFragmentManager); }; UpdateBreadCrumb(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_map); mFragmentManager = SupportFragmentManager; mFragmentManager.AddOnBackStackChangedListener(this); mFragmentBreadCrumbs = FindViewById<FragmentBreadCrumbs>(Resource.Id.breadcrumbs); mFragmentBreadCrumbs.SetActivity(this); mMapFragment = (MapFragment)mFragmentManager.FindFragmentByTag("map"); if (mMapFragment == null) { mMapFragment = new MapFragment(); mMapFragment.Arguments = IntentToFragmentArguments(Intent); mFragmentManager.BeginTransaction() .Add(Resource.Id.fragment_container_map, mMapFragment, "map") .Commit(); } FindViewById<ImageButton>(Resource.Id.close_button).Click += (sender, e) => { ClearBackStack(SupportFragmentManager); }; UpdateBreadCrumb(); }