protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); // Create your application here SetContentView (Resource.Layout.TripDetails); var detailFragment = new TripDetailFragment (); detailFragment.Arguments = new Bundle (); if (Intent.HasExtra("trip")){ string tripJson = Intent.GetStringExtra ("trip"); detailFragment.Arguments.PutString ("trip", tripJson); } FragmentTransaction ft = FragmentManager.BeginTransaction (); ft.Add (Resource.Id.tripDetailLayout, detailFragment); ft.Commit (); }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Resource.Id.actionNew: if (DVELActivity.isDualMode) { var detailFragment = new TripDetailFragment(); FragmentTransaction ft = FragmentManager.BeginTransaction (); ft.Replace (Resource.Id.tripDetailLayout, detailFragment); ft.Commit (); } else { Intent intent = new Intent (activity, typeof(TripDetailActivity)); StartActivity (intent); } return true; case Resource.Id.actionRefresh: DownloadTripListAsync (); return true; default: return base.OnOptionsItemSelected (item); } }