protected virtual void ShowDetails(string url) { SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.sample_content, DetailFragment.NewInstance(url)) .AddToBackStack(null) .Commit(); }
/// <summary> /// Raises the create event. /// </summary> /// <param name="savedInstanceState">c</param> protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ActivityDetailContent); ActionBar.Title = GetString(Resource.String.format_detail_activity_label_format, Intent.GetStringExtra(DetailFragment.ArgActivityName)); ActionBar.SetDisplayHomeAsUpEnabled(true); if (savedInstanceState == null) { // Create the detail fragment and add it to the activity // using a fragment transaction. var df = DetailFragment.NewInstance(Intent.GetIntExtra(DetailFragment.ArgActivityId, -1)); FragmentManager.BeginTransaction() .Replace(Resource.Id.activity_detail_container, df) .Commit(); } }