Наследование: Android.Support.V4.App.Fragment
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			RequestWindowFeature (WindowFeatures.NoTitle);

			SetContentView (Resource.Layout.Main);

			list = new ListFragment ();

			SupportFragmentManager
				.BeginTransaction ()
				.Add (Resource.Id.fragmentHost, list)
				.Commit ();

			//LoadList ();

			var btn = FindViewById<Button> (Resource.Id.btn);
			btn.Text = "Switch View";
			btn.Click += (sender, e) => {
//				list.SetEmptyText ("The monkeys ran off");
//				adapter.Clear ();
				viewPager = new ViewPagerFragment ();
				SupportFragmentManager
					.BeginTransaction ()
					.Replace (Resource.Id.fragmentHost, viewPager)
					.Commit ();
				((View)sender).Visibility = ViewStates.Gone;
			};
		}
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);

            SetContentView(Resource.Layout.Main);

            list = new ListFragment();

            SupportFragmentManager
            .BeginTransaction()
            .Add(Resource.Id.fragmentHost, list)
            .Commit();

            //LoadList ();

            var btn = FindViewById <Button> (Resource.Id.btn);

            btn.Text   = "Switch View";
            btn.Click += (sender, e) => {
//				list.SetEmptyText ("The monkeys ran off");
//				adapter.Clear ();
                viewPager = new ViewPagerFragment();
                SupportFragmentManager
                .BeginTransaction()
                .Replace(Resource.Id.fragmentHost, viewPager)
                .Commit();
                ((View)sender).Visibility = ViewStates.Gone;
            };
        }