コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState) {
            base.OnCreate(savedInstanceState);
            FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.FILL_PARENT,
                    ViewGroup.LayoutParams.FILL_PARENT);
            FrameLayout frame = new FrameLayout(this);
            frame.SetId(R.Id.simple_fragment);
            SetContentView(frame, lp);

            if (savedInstanceState == null) {
                // Do first time initialization -- Add fragment.
                Fragment newFragment = new ReceiveResultFragment();
                FragmentTransaction ft = GetSupportFragmentManager().BeginTransaction();
                ft.Add(R.Id.simple_fragment, newFragment).Commit();
            }
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT);
            FrameLayout frame = new FrameLayout(this);

            frame.SetId(R.Ids.simple_fragment);
            SetContentView(frame, lp);

            if (savedInstanceState == null)
            {
                // Do first time initialization -- Add fragment.
                Fragment            newFragment = new ReceiveResultFragment();
                FragmentTransaction ft          = GetSupportFragmentManager().BeginTransaction();
                ft.Add(R.Ids.simple_fragment, newFragment).Commit();
            }
        }