コード例 #1
0
        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 ();
        }
コード例 #2
0
ファイル: fragments.cs プロジェクト: heb264/ITC539_VEL
		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);
			}
		}