Esempio n. 1
0
        // public override void OnCreate(Bundle savedInstanceState)
        //  {
        //      base.OnCreate(savedInstanceState);

        // Create your fragment here
        //    }

        public static WorkoutFragment NewInstance()
        {
            var frag3 = new WorkoutFragment {
                Arguments = new Bundle()
            };

            return(frag3);
        }
Esempio n. 2
0
        void LoadFragment(int id)
        {
            //creating, linking and putting the keyboard into a bundle
            keyboard = FindViewById <Keyboard>(Resource.Id.keyboard_weights);
            Bundle mybundle = new Bundle();

            mybundle.PutSerializable("keyboard", keyboard);

            Android.Support.V4.App.Fragment fragment = null;
            //int title = 0;
            switch (id)
            {
            case Resource.Id.action_home:
                fragment           = HomeFragment.NewInstance();
                fragment.Arguments = mybundle;
                //title = Resource.String.home;
                break;

            case Resource.Id.action_calender:
                fragment = CalendarFragment.NewInstance();
                //title = Resource.String.calendar;
                break;

            case Resource.Id.action_workout:
                fragment = WorkoutFragment.NewInstance();
                //title = Resource.String.workout;
                break;

            case Resource.Id.action_settings:
                fragment = SettingsFragment.NewInstance();
                //title = Resource.String.settings;
                break;
            }
            if (fragment == null)
            {
                return;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();

            //if (title!=0) SupportActionBar.SetTitle(title);
        }