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(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate (savedInstanceState); var lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent,ViewGroup.LayoutParams.MatchParent); var frame = new FrameLayout(this); frame.Id = Resource.Id.simple_fragment; SetContentView(frame, lp); if (savedInstanceState == null) { // Do first time initialization -- add fragment. var newFragment = new ReceiveResultFragment(); var ft = SupportFragmentManager.BeginTransaction(); ft.Add(Resource.Id.simple_fragment, newFragment).Commit(); } // Create your application here }
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(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); var frame = new FrameLayout(this); frame.Id = Resource.Id.simple_fragment; SetContentView(frame, lp); if (savedInstanceState == null) { // Do first time initialization -- add fragment. var newFragment = new ReceiveResultFragment(); var ft = SupportFragmentManager.BeginTransaction(); ft.Add(Resource.Id.simple_fragment, newFragment).Commit(); } // Create your application here }